aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/generics
diff options
context:
space:
mode:
authoraclement <aclement>2005-08-19 16:16:46 +0000
committeraclement <aclement>2005-08-19 16:16:46 +0000
commit524b9af6ae16643b580d8bdb05bccf319ccc528f (patch)
tree283ea3bb7a9a2a9c4231cdc4b747a2836fddb1bb /tests/java5/generics
parent2fbf2933e6b75fcac32e4b725227aa4ee70d2e79 (diff)
downloadaspectj-524b9af6ae16643b580d8bdb05bccf319ccc528f.tar.gz
aspectj-524b9af6ae16643b580d8bdb05bccf319ccc528f.zip
genericitds: more funky tests.
Diffstat (limited to 'tests/java5/generics')
-rw-r--r--tests/java5/generics/genericaspects/GenericAspectQ.aj33
1 files changed, 21 insertions, 12 deletions
diff --git a/tests/java5/generics/genericaspects/GenericAspectQ.aj b/tests/java5/generics/genericaspects/GenericAspectQ.aj
index bd73e6796..c27255c5c 100644
--- a/tests/java5/generics/genericaspects/GenericAspectQ.aj
+++ b/tests/java5/generics/genericaspects/GenericAspectQ.aj
@@ -1,29 +1,37 @@
+// Testing interactions between ITD methods and the fields that might exist
+// on a generic type...
import java.util.*;
import java.lang.reflect.*;
import org.aspectj.lang.annotation.*;
class I<A> {
A a;
+ List<A> b;
}
aspect Foo {
-// B I<B>.b;
+ C I<C>.m0() {
+ return a;
+ }
+
+ List<C> I<C>.m1() {
+ return b;
+ }
- C I<C>.m() {
- return x;
+ void I<C>.setA(C aC) {
+ a = aC;
}
- /*
- In something like the above, although 'Z' is clearly a reference to
- a member type variable, it is captured in the 'code' for the method as a
- SingleTypeReference for Z. It doesnt cause a problem with a 'missing type'
- because the compiler looks up the types in the set of type vars for a
- member - in this case it will find Z and everything will be ok.
- The problem above is that the type of x is 'A' and yet the return type
- of the method is 'C' - they dont match => BANG
+ void I<L>.setB(List<L> aB) {
+ b = aB;
+ }
+
+ List<C> I<C>.swap(List<C> cs1,List<C> cs2) {
+ cs1=cs2;
+ return cs1;
+ }
- */
}
public class GenericAspectQ extends I<String> {
@@ -31,4 +39,5 @@ public class GenericAspectQ extends I<String> {
public static void main(String []argv) {
GenericAspectQ _instance = new GenericAspectQ();
}
+
}