summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-08-24 14:30:23 +0000
committeraclement <aclement>2005-08-24 14:30:23 +0000
commit4fbd49aac473de47e08f2dc64b9617fd804a20ae (patch)
treec924ac7168f10e8d7ea26208ff0d4ebad8de4c81
parent488ccb7083806fba4720e1fee9e68d38380c3ea8 (diff)
downloadaspectj-4fbd49aac473de47e08f2dc64b9617fd804a20ae.tar.gz
aspectj-4fbd49aac473de47e08f2dc64b9617fd804a20ae.zip
generic itd bridge method test code.
-rw-r--r--tests/java5/generics/itds/bridgeMethods/Sub1.java3
-rw-r--r--tests/java5/generics/itds/bridgeMethods/Sub2.java2
-rw-r--r--tests/java5/generics/itds/bridgeMethods/Sub3.java3
-rw-r--r--tests/java5/generics/itds/bridgeMethods/Super1.java3
-rw-r--r--tests/java5/generics/itds/bridgeMethods/Super2.java3
-rw-r--r--tests/java5/generics/itds/bridgeMethods/Super3.java2
-rw-r--r--tests/java5/generics/itds/bridgeMethods/Util.java2
-rw-r--r--tests/java5/generics/itds/bridgeMethods/X1.aj11
-rw-r--r--tests/java5/generics/itds/bridgeMethods/X2.aj13
-rw-r--r--tests/java5/generics/itds/bridgeMethods/X3.aj14
-rw-r--r--tests/java5/generics/itds/bridgeMethods/pr91381.aj16
11 files changed, 71 insertions, 1 deletions
diff --git a/tests/java5/generics/itds/bridgeMethods/Sub1.java b/tests/java5/generics/itds/bridgeMethods/Sub1.java
new file mode 100644
index 000000000..5cdc88cf0
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/Sub1.java
@@ -0,0 +1,3 @@
+public class Sub1 extends Super1 {
+ public Integer m() {return new Integer(42);}
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/Sub2.java b/tests/java5/generics/itds/bridgeMethods/Sub2.java
new file mode 100644
index 000000000..dffb52b48
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/Sub2.java
@@ -0,0 +1,2 @@
+public class Sub2 extends Super2 {
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/Sub3.java b/tests/java5/generics/itds/bridgeMethods/Sub3.java
new file mode 100644
index 000000000..c6ebe8b94
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/Sub3.java
@@ -0,0 +1,3 @@
+public class Sub3 extends Super3 {
+ public Integer m() {return new Integer(42);}
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/Super1.java b/tests/java5/generics/itds/bridgeMethods/Super1.java
new file mode 100644
index 000000000..390ac1a6d
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/Super1.java
@@ -0,0 +1,3 @@
+public class Super1 {
+ public Object m() { return null;}
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/Super2.java b/tests/java5/generics/itds/bridgeMethods/Super2.java
new file mode 100644
index 000000000..4d447a3cc
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/Super2.java
@@ -0,0 +1,3 @@
+public class Super2 {
+ public Object m() { return null;}
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/Super3.java b/tests/java5/generics/itds/bridgeMethods/Super3.java
new file mode 100644
index 000000000..d9e713cbb
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/Super3.java
@@ -0,0 +1,2 @@
+public class Super3 {
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/Util.java b/tests/java5/generics/itds/bridgeMethods/Util.java
index 2016f1d4d..1c479defa 100644
--- a/tests/java5/generics/itds/bridgeMethods/Util.java
+++ b/tests/java5/generics/itds/bridgeMethods/Util.java
@@ -3,7 +3,7 @@ import java.util.*;
public class Util {
- public static void dumpMethods(String clazzname,String[] expectedMethods) {
+ public static void checkMethods(String clazzname,String[] expectedMethods) {
List methodsFound = new ArrayList();
try {
java.lang.Class clz = Class.forName(clazzname);
diff --git a/tests/java5/generics/itds/bridgeMethods/X1.aj b/tests/java5/generics/itds/bridgeMethods/X1.aj
new file mode 100644
index 000000000..9ff893ce0
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/X1.aj
@@ -0,0 +1,11 @@
+public aspect X1 {
+ public static void main(String []argv) {
+ Super1 s = new Sub1();
+ Integer i = (Integer)s.m();
+
+ Util.checkMethods("Sub1",
+ new String[]{
+ "java.lang.Object Sub1.m() [BridgeMethod]",
+ "java.lang.Integer Sub1.m()"});
+ }
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/X2.aj b/tests/java5/generics/itds/bridgeMethods/X2.aj
new file mode 100644
index 000000000..cd9eccffa
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/X2.aj
@@ -0,0 +1,13 @@
+public aspect X2 {
+ public Integer Sub2.m() {return new Integer(42);}
+
+ public static void main(String []argv) {
+ Super2 s = new Sub2();
+ Integer i = (Integer)s.m();
+
+ Util.checkMethods("Sub2",
+ new String[]{
+ "java.lang.Object Sub2.m() [BridgeMethod]",
+ "java.lang.Integer Sub2.m()"});
+ }
+} \ No newline at end of file
diff --git a/tests/java5/generics/itds/bridgeMethods/X3.aj b/tests/java5/generics/itds/bridgeMethods/X3.aj
new file mode 100644
index 000000000..dc58e33b8
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/X3.aj
@@ -0,0 +1,14 @@
+public aspect X3 {
+
+ public Object Super3.m() {return null;}
+
+ public static void main(String []argv) {
+ Super3 s = new Sub3();
+ Integer i = (Integer)s.m();
+
+ Util.checkMethods("Sub3",
+ new String[]{
+ "java.lang.Object Sub3.m() [BridgeMethod]",
+ "java.lang.Integer Sub3.m()"});
+ }
+}
diff --git a/tests/java5/generics/itds/bridgeMethods/pr91381.aj b/tests/java5/generics/itds/bridgeMethods/pr91381.aj
new file mode 100644
index 000000000..b28729e0b
--- /dev/null
+++ b/tests/java5/generics/itds/bridgeMethods/pr91381.aj
@@ -0,0 +1,16 @@
+public aspect pr91381 {
+ public abstract Object A.foo();
+
+ public static void main(String[] args) {
+ A a = new B();
+ System.out.println(a.foo());
+ }
+}
+
+abstract class A {
+// abstract Object foo();
+}
+
+class B extends A {
+ @Override public Integer foo() { return new Integer(42); }
+}