From b30404f156adb6e01bfe4edc50b4de4245ba4509 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Fri, 12 Nov 2021 11:58:05 +0100 Subject: Separate B from A test files So we are closer to a realistic setup and can tell when we accidentally look up a class in the wrong project. Also allows us to have changes in a class but not to the class or its package (i.e. same file). --- src/testA/java/a/pkg/A.java | 104 +++++++++++++++++++++++++++++++++++ src/testA/java/a/pkg/AInterface.java | 5 ++ src/testA/java/a/pkg/AParent.java | 7 +++ 3 files changed, 116 insertions(+) create mode 100644 src/testA/java/a/pkg/A.java create mode 100644 src/testA/java/a/pkg/AInterface.java create mode 100644 src/testA/java/a/pkg/AParent.java (limited to 'src/testA/java/a') diff --git a/src/testA/java/a/pkg/A.java b/src/testA/java/a/pkg/A.java new file mode 100644 index 0000000..f4a30ef --- /dev/null +++ b/src/testA/java/a/pkg/A.java @@ -0,0 +1,104 @@ +package a.pkg; + +public class A extends AParent implements AInterface { + private A a; + private int aField; + + public A() { + } + + public A(A arg) { + } + + public static A create() { return new A(); } + + public void aMethod() { + aInterfaceMethod(); + } + + public A getA() { + return this; + } + + public A getSyntheticA() { + return this; + } + + public void setSyntheticA(A arg) { + } + + public boolean isSyntheticBooleanA() { + return false; + } + + public void setSyntheticBooleanA(boolean arg) { + } + + public A getNonSyntheticA() { + return this; + } + + public void setNonSyntheticA(A arg) { + } + + public boolean isNonSyntheticBooleanA() { + return false; + } + + public void setNonSyntheticBooleanA(boolean arg) { + } + + public A getterA() { + return this; + } + + public void setterA(A arg) { + } + + public boolean getterBooleanA() { + return false; + } + + public void setterBooleanA(boolean arg) { + } + + public int conflictingField; + public int getConflictingFieldWithoutConflict() { + return conflictingField; + } + + public void aOverloaded() { + } + + public void aOverloaded(int arg) { + } + + public void aOverloaded(boolean arg) { + } + + public void commonOverloaded(Object arg) { + } + + public void commonOverloaded(A arg) { + } + + public void unmappedOverloaded(Object arg) { + } + + public void unmappedOverloaded(A arg) { + } + + @Override + public void aInterfaceMethod() { + new A() {}; + } + + public class Inner { + private int aField; + } + + public class InnerA { + } + + public class GenericA {} +} diff --git a/src/testA/java/a/pkg/AInterface.java b/src/testA/java/a/pkg/AInterface.java new file mode 100644 index 0000000..8786c94 --- /dev/null +++ b/src/testA/java/a/pkg/AInterface.java @@ -0,0 +1,5 @@ +package a.pkg; + +public interface AInterface { + void aInterfaceMethod(); +} diff --git a/src/testA/java/a/pkg/AParent.java b/src/testA/java/a/pkg/AParent.java new file mode 100644 index 0000000..ac0ea7c --- /dev/null +++ b/src/testA/java/a/pkg/AParent.java @@ -0,0 +1,7 @@ +package a.pkg; + +public class AParent { + public AParent aParentMethod() { + return this; + } +} -- cgit