diff options
author | aclement <aclement> | 2007-10-29 16:03:10 +0000 |
---|---|---|
committer | aclement <aclement> | 2007-10-29 16:03:10 +0000 |
commit | 3fb03ca8295926e82a14dfff3319bd7dd497a881 (patch) | |
tree | 46883854009b218e4a9a952ebab8daeb58e2d164 /tests/bugs154 | |
parent | 427211607630ca82f9f68c990cbf372aefe5b587 (diff) | |
download | aspectj-3fb03ca8295926e82a14dfff3319bd7dd497a881.tar.gz aspectj-3fb03ca8295926e82a14dfff3319bd7dd497a881.zip |
203646: tests and fixes for ITD method on generic inner type
Diffstat (limited to 'tests/bugs154')
-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 |
8 files changed, 163 insertions, 0 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 |