--- /dev/null
+// fails
+
+interface I {
+ interface J< T > {}
+}
+
+public aspect Bang {
+ public void I.J< T >.intro() {}
+}
\ No newline at end of file
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+interface I {
+ interface J< T > {
+ T getT();
+ }
+}
+public aspect ExampleG {
+ public T I.J< T >.intro() {
+ return null;
+ }
+}
\ No newline at end of file
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");
// 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"); }
<!-- 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"/>