summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/java5/generics/itds/GenericMethodITD10.aj19
-rw-r--r--tests/java5/generics/itds/GenericMethodITD7.aj20
-rw-r--r--tests/java5/generics/itds/GenericMethodITD8.aj20
-rw-r--r--tests/java5/generics/itds/GenericMethodITD9.aj22
4 files changed, 81 insertions, 0 deletions
diff --git a/tests/java5/generics/itds/GenericMethodITD10.aj b/tests/java5/generics/itds/GenericMethodITD10.aj
new file mode 100644
index 000000000..1e38a1594
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD10.aj
@@ -0,0 +1,19 @@
+import java.util.*;
+
+class Base {
+}
+
+public class GenericMethodITD10 {
+
+ public static void main(String[] argv) {
+ List<A> as = new ArrayList<A>();
+ new Base().crazy(as); // A is not Comparable
+ }
+}
+
+class A {
+}
+
+aspect X {
+ <R extends Comparable<? super R>> void Base.crazy(List<R> lr) {}
+}
diff --git a/tests/java5/generics/itds/GenericMethodITD7.aj b/tests/java5/generics/itds/GenericMethodITD7.aj
new file mode 100644
index 000000000..923f71692
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD7.aj
@@ -0,0 +1,20 @@
+import java.util.*;
+
+class Base { }
+
+public class GenericMethodITD7 {
+
+ public static void main(String[] argv) {
+ List<Number> ns = new ArrayList<Number>();
+ List<Double> ds = new ArrayList<Double>();
+ new Base().simple(ns,ds); // ok, List<Number> and List<Double>
+ }
+}
+
+class Super {}
+
+class A extends Super {}
+
+aspect X {
+ <E> void Base.simple(List<E> lista,List<? extends E> listb) {}
+}
diff --git a/tests/java5/generics/itds/GenericMethodITD8.aj b/tests/java5/generics/itds/GenericMethodITD8.aj
new file mode 100644
index 000000000..8f8f5fc44
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD8.aj
@@ -0,0 +1,20 @@
+import java.util.*;
+
+class Base { }
+
+public class GenericMethodITD8 {
+
+ public static void main(String[] argv) {
+ List<Number> ns = new ArrayList<Number>();
+ List<String> ss = new ArrayList<String>();
+ new Base().simple(ns,ss); // error, ss doesn't fit List<? extends E>
+ }
+}
+
+class Super {}
+
+class A extends Super {}
+
+aspect X {
+ <E> void Base.simple(List<E> list1,List<? extends E> list2) {}
+}
diff --git a/tests/java5/generics/itds/GenericMethodITD9.aj b/tests/java5/generics/itds/GenericMethodITD9.aj
new file mode 100644
index 000000000..d7f20909b
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD9.aj
@@ -0,0 +1,22 @@
+import java.util.*;
+
+class Base {
+}
+
+public class GenericMethodITD9 {
+
+ public static void main(String[] argv) {
+ List<A> as = new ArrayList<A>();
+ new Base().crazy(as); // ok !
+ }
+}
+
+class A implements Comparable<A> {
+ public int compareTo(A anotherA) {
+ return 0;
+ }
+}
+
+aspect X {
+ public <R extends Comparable<? super R>> void Base.crazy(List<R> lr) {}
+}