aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs162
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs162')
-rw-r--r--tests/bugs162/pr145391/B.classbin0 -> 433 bytes
-rw-r--r--tests/bugs162/pr145391/GenericType.java38
-rw-r--r--tests/bugs162/pr145391/GenericType2.java25
-rw-r--r--tests/bugs162/pr145391/x/GenericType2.java25
4 files changed, 88 insertions, 0 deletions
diff --git a/tests/bugs162/pr145391/B.class b/tests/bugs162/pr145391/B.class
new file mode 100644
index 000000000..e91f70136
--- /dev/null
+++ b/tests/bugs162/pr145391/B.class
Binary files differ
diff --git a/tests/bugs162/pr145391/GenericType.java b/tests/bugs162/pr145391/GenericType.java
new file mode 100644
index 000000000..897e1b729
--- /dev/null
+++ b/tests/bugs162/pr145391/GenericType.java
@@ -0,0 +1,38 @@
+public class GenericType<V extends Integer> {
+
+ public GenericType(V value) {}
+
+ public void foo() {}
+//
+// public void bar() {}
+
+ protected V getValue() {
+ return null;
+ }
+
+ public static void main(String[] args) {
+ new GenericType<Integer>(null).foo();
+ }
+
+}
+
+aspect SomeAspect {
+ before(GenericType t): call(* GenericType.foo()) && target(t) {
+ // Direct call to non-generic method works
+// t.bar();
+ // Indirect call to non-generic method works
+// t.callNormalMethod();
+ // Direct call to generic method works
+// t.getValue();
+ // Indirect call to generic method produces a NoSuchMethodError
+ t.callGenericMethod();
+ }
+
+// private void GenericType.callNormalMethod() {
+// bar();
+// }
+
+ private void GenericType.callGenericMethod() {
+ getValue();
+ }
+} \ No newline at end of file
diff --git a/tests/bugs162/pr145391/GenericType2.java b/tests/bugs162/pr145391/GenericType2.java
new file mode 100644
index 000000000..c99919e88
--- /dev/null
+++ b/tests/bugs162/pr145391/GenericType2.java
@@ -0,0 +1,25 @@
+public class GenericType2<V extends Integer> {
+
+ public GenericType2(V value) {}
+
+ public void foo() {}
+
+ protected void getValue(V aV) {
+ }
+
+ public static void main(String[] args) {
+ new GenericType2<Integer>(null).foo();
+ }
+
+}
+
+aspect SomeAspect {
+ before(GenericType2 t): call(* GenericType2.foo()) && target(t) {
+ // Indirect call to generic method produces a NoSuchMethodError
+ t.callGenericMethod();
+ }
+
+ private void GenericType2.callGenericMethod() {
+ getValue(new Integer(45));
+ }
+}
diff --git a/tests/bugs162/pr145391/x/GenericType2.java b/tests/bugs162/pr145391/x/GenericType2.java
new file mode 100644
index 000000000..8d5fb565c
--- /dev/null
+++ b/tests/bugs162/pr145391/x/GenericType2.java
@@ -0,0 +1,25 @@
+interface Bar {}
+
+class B implements Bar {}
+
+public class GenericType2<V extends Bar> {
+
+ public GenericType2(V value) {}
+
+ protected void getValue(V aV) {
+ }
+ public void m() {
+ getValue(new B());
+}
+}
+
+aspect SomeAspect {
+ before(GenericType2 t): call(* GenericType2.foo()) && target(t) {
+ // Indirect call to generic method produces a NoSuchMethodError
+ t.callGenericMethod();
+ }
+
+ private void GenericType2.callGenericMethod() {
+// getValue(new Integer(45));
+ }
+}