diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs154/pr203646/Bang.java | 9 | ||||
-rw-r--r-- | tests/bugs154/pr203646/ExampleA.java | 22 | ||||
-rw-r--r-- | tests/bugs154/pr203646/ExampleB.java | 22 | ||||
-rw-r--r-- | tests/bugs154/pr203646/ExampleC.java | 26 | ||||
-rw-r--r-- | tests/bugs154/pr203646/ExampleD.java | 26 | ||||
-rw-r--r-- | tests/bugs154/pr203646/ExampleE.java | 23 | ||||
-rw-r--r-- | tests/bugs154/pr203646/ExampleF.java | 25 | ||||
-rw-r--r-- | tests/bugs154/pr203646/ExampleG.java | 10 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java | 6 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java | 9 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc154/ajc154.xml | 44 |
11 files changed, 219 insertions, 3 deletions
diff --git a/tests/bugs154/pr203646/Bang.java b/tests/bugs154/pr203646/Bang.java new file mode 100644 index 000000000..0b7ba7445 --- /dev/null +++ b/tests/bugs154/pr203646/Bang.java @@ -0,0 +1,9 @@ +// fails + +interface I { + interface J< T > {} +} + +public aspect Bang { + public void I.J< T >.intro() {} +}
\ No newline at end of file diff --git a/tests/bugs154/pr203646/ExampleA.java b/tests/bugs154/pr203646/ExampleA.java new file mode 100644 index 000000000..b1ceced01 --- /dev/null +++ b/tests/bugs154/pr203646/ExampleA.java @@ -0,0 +1,22 @@ +// ITD of a method onto a generic inner type - working example + +interface I { + interface J< T > {} +} + +aspect Bang { + public int I.J<T>.intro(T t) {return 42;} +} + +class Impl implements I { + class InnerImpl implements J<String> { + } +} + +public class ExampleA { + public static void main(String []argv) { + Impl i = new Impl(); + Impl.InnerImpl j = i.new InnerImpl(); + System.out.println(j.intro("foo")); + } +}
\ No newline at end of file diff --git a/tests/bugs154/pr203646/ExampleB.java b/tests/bugs154/pr203646/ExampleB.java new file mode 100644 index 000000000..e3047b559 --- /dev/null +++ b/tests/bugs154/pr203646/ExampleB.java @@ -0,0 +1,22 @@ +// ITD of a method onto a generic inner type - failing example, passes wrongly typed parameter on the call + +interface I { + interface J< T > {} +} + +aspect Bang { + public int I.J<T>.intro(T t) {return 42;} +} + +class Impl implements I { + class InnerImpl implements J<String> { + } +} + +public class ExampleB { + public static void main(String []argv) { + Impl i = new Impl(); + Impl.InnerImpl j = i.new InnerImpl(); + System.out.println(j.intro(8)); + } +}
\ No newline at end of file diff --git a/tests/bugs154/pr203646/ExampleC.java b/tests/bugs154/pr203646/ExampleC.java new file mode 100644 index 000000000..a42ac4eb7 --- /dev/null +++ b/tests/bugs154/pr203646/ExampleC.java @@ -0,0 +1,26 @@ +// ITD of a method onto a generic inner inner type + +interface I { + interface J { + interface K<T> {} + } +} + +aspect Bang { + public int I.J.K<T>.intro(T t) {return 42;} +} + +class Impl implements I { + class InnerImpl implements J { + class InnerInnerImpl implements K<String> {} + } +} + +public class ExampleC { + public static void main(String []argv) { + Impl i = new Impl(); + Impl.InnerImpl j = i.new InnerImpl(); + Impl.InnerImpl.InnerInnerImpl k = j.new InnerInnerImpl(); + System.out.println(k.intro("foo")); + } +}
\ No newline at end of file diff --git a/tests/bugs154/pr203646/ExampleD.java b/tests/bugs154/pr203646/ExampleD.java new file mode 100644 index 000000000..f91cff76c --- /dev/null +++ b/tests/bugs154/pr203646/ExampleD.java @@ -0,0 +1,26 @@ +// ITD of a method onto a generic inner type - working example + +interface I { + interface J<T> { + interface K {} + } +} + +aspect Bang { + public int I.J<P>.intro(P t) {return 42;} +} + +class Impl implements I { + class InnerImpl implements J<String> { + class InnerInnerImpl implements K {} + } +} + +public class ExampleD { + public static void main(String []argv) { + Impl i = new Impl(); + Impl.InnerImpl j = i.new InnerImpl(); + Impl.InnerImpl.InnerInnerImpl k = j.new InnerInnerImpl(); + System.out.println(j.intro("foo")); + } +}
\ No newline at end of file diff --git a/tests/bugs154/pr203646/ExampleE.java b/tests/bugs154/pr203646/ExampleE.java new file mode 100644 index 000000000..75de4151d --- /dev/null +++ b/tests/bugs154/pr203646/ExampleE.java @@ -0,0 +1,23 @@ +// ITD of a method onto a generic inner type - complex example + +interface I<P> { + interface J<Q> { + } +} + +aspect Bang { + public int I<A>.J<B>.intro(A a,B b) {return 42;} +} + +class Impl implements I<Integer> { + class InnerImpl implements J<String> { + } +} + +public class ExampleE { + public static void main(String []argv) { + Impl i = new Impl(); + Impl.InnerImpl j = i.new InnerImpl(); + System.out.println(j.intro(new Integer(5),"foo")); + } +}
\ No newline at end of file diff --git a/tests/bugs154/pr203646/ExampleF.java b/tests/bugs154/pr203646/ExampleF.java new file mode 100644 index 000000000..9c7e16f46 --- /dev/null +++ b/tests/bugs154/pr203646/ExampleF.java @@ -0,0 +1,25 @@ +// ITD of a method onto a generic inner type - complex example + +class Goo {} + +interface I { + interface J<Q extends Goo> { + } +} + +aspect Bang { + public int I.J.intro(String a,Integer b) {return 42;} +} + +class Impl implements I { + class InnerImpl implements J { + } +} + +public class ExampleF { + public static void main(String []argv) { + Impl i = new Impl(); + Impl.InnerImpl j = i.new InnerImpl(); + System.out.println(j.intro("o",new Integer(3))); + } +}
\ No newline at end of file diff --git a/tests/bugs154/pr203646/ExampleG.java b/tests/bugs154/pr203646/ExampleG.java new file mode 100644 index 000000000..7063ea95a --- /dev/null +++ b/tests/bugs154/pr203646/ExampleG.java @@ -0,0 +1,10 @@ +interface I { + interface J< T > { + T getT(); + } +} +public aspect ExampleG { + public T I.J< T >.intro() { + return null; + } +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java index 8d4203db2..43cf61620 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java @@ -149,9 +149,9 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { expected, ipe.getSourceSignature()); } - public void testNPEWithCustomAgent_pr158005() { - runTest("NPE with custom agent"); - } +// public void testNPEWithCustomAgent_pr158205() { +// runTest("NPE with custom agent"); +// } public void testWeaveConcreteSubaspectWithAdvice_pr132080() { runTest("Weave concrete sub-aspect with advice"); diff --git a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java index af2542ccc..12671fd55 100644 --- a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java @@ -45,6 +45,15 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // runTest("new pointcut designators in a reference pointcut"); // } + public void testItdOnGenericInnerInterface_pr203646() { runTest("npe with itd on inner generic interface");} + public void testItdOnGenericInnerInterface_pr203646_A() { runTest("npe with itd on inner generic interface - exampleA");} + public void testItdOnGenericInnerInterface_pr203646_B() { runTest("npe with itd on inner generic interface - exampleB");} + public void testItdOnGenericInnerInterface_pr203646_C() { runTest("npe with itd on inner generic interface - exampleC");} + public void testItdOnGenericInnerInterface_pr203646_D() { runTest("npe with itd on inner generic interface - exampleD");} +// public void testItdOnGenericInnerInterface_pr203646_E() { runTest("npe with itd on inner generic interface - exampleE");} // needs parser change + public void testItdOnGenericInnerInterface_pr203646_F() { runTest("npe with itd on inner generic interface - exampleF");} + public void testItdOnGenericInnerInterface_pr203646_G() { runTest("npe with itd on inner generic interface - exampleG");} + public void testItdClashForTypesFromAspectPath_pr206732() { runTest("itd clash for types from aspectpath"); } // public void testAnnotationStyleAndMultiplePackages_pr197719() { runTest("annotation style syntax and cross package extension"); } diff --git a/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml b/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml index a2d3f79e5..02d6e8971 100644 --- a/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml +++ b/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml @@ -3,6 +3,50 @@ <!-- AspectJ v1.6.0 Tests --> <suite> + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface"> + <compile options="-1.5" files="Bang.java"/> + <!--compile options="-1.5 -emacssym" files="Bang.java"/--> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - emacssym"> + <compile options="-1.5 -emacssym" files="Bang.java"/> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - exampleA"> + <compile options="-1.5" files="ExampleA.java"/> + <run class="ExampleA"/> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - exampleB"> + <compile options="-1.5" files="ExampleB.java"> + <message kind="error" line="20" text="The method intro(String) in the type I.J<String> is not applicable for the arguments (int)"/> + </compile> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - exampleC"> + <compile options="-1.5" files="ExampleC.java"/> + <run class="ExampleC"/> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - exampleD"> + <compile options="-1.5" files="ExampleD.java"/> + <run class="ExampleD"/> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - exampleE"> + <compile options="-1.5" files="ExampleE.java"/> + <run class="ExampleE"/> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - exampleF"> + <compile options="-1.5" files="ExampleF.java"/> + <run class="ExampleF"/> + </ajc-test> + + <ajc-test dir="bugs154/pr203646" title="npe with itd on inner generic interface - exampleG"> + <compile options="-1.5" files="ExampleG.java"/> + </ajc-test> + <ajc-test dir="bugs154/pr206732" title="itd clash for types from aspectpath"> <compile outjar="foo.jar" files="Advised.aj"/> <compile files="Ref.aj" aspectpath="foo.jar"/> |