aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs152
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-07 08:19:14 +0000
committeraclement <aclement>2006-06-07 08:19:14 +0000
commite769745da4ba14cb68c220b33f0232a920eeafae (patch)
tree02ee827b4fe0ef4ec86236c5905936a458dd14c2 /tests/bugs152
parent3e0650d8a084248c4eb93f22cd8abfdabe6ba2a8 (diff)
downloadaspectj-e769745da4ba14cb68c220b33f0232a920eeafae.tar.gz
aspectj-e769745da4ba14cb68c220b33f0232a920eeafae.zip
testcode for 145391,145693
Diffstat (limited to 'tests/bugs152')
-rw-r--r--tests/bugs152/pr145391/GenericType.java38
-rw-r--r--tests/bugs152/pr145391/GenericType2.java37
-rw-r--r--tests/bugs152/pr145693/Event.java1
-rw-r--r--tests/bugs152/pr145693/Monitor.aj12
-rw-r--r--tests/bugs152/pr145693/Sample.java9
5 files changed, 97 insertions, 0 deletions
diff --git a/tests/bugs152/pr145391/GenericType.java b/tests/bugs152/pr145391/GenericType.java
new file mode 100644
index 000000000..897e1b729
--- /dev/null
+++ b/tests/bugs152/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/bugs152/pr145391/GenericType2.java b/tests/bugs152/pr145391/GenericType2.java
new file mode 100644
index 000000000..c5c6ab386
--- /dev/null
+++ b/tests/bugs152/pr145391/GenericType2.java
@@ -0,0 +1,37 @@
+public class GenericType2<V extends Integer> {
+
+ public GenericType2(V value) {}
+
+ public void foo() {}
+//
+// public void bar() {}
+
+ 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) {
+ // 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 GenericType2.callGenericMethod() {
+ getValue(new Integer(45));
+ }
+} \ No newline at end of file
diff --git a/tests/bugs152/pr145693/Event.java b/tests/bugs152/pr145693/Event.java
new file mode 100644
index 000000000..e2a8b628a
--- /dev/null
+++ b/tests/bugs152/pr145693/Event.java
@@ -0,0 +1 @@
+public class Event {}
diff --git a/tests/bugs152/pr145693/Monitor.aj b/tests/bugs152/pr145693/Monitor.aj
new file mode 100644
index 000000000..51b37855a
--- /dev/null
+++ b/tests/bugs152/pr145693/Monitor.aj
@@ -0,0 +1,12 @@
+public aspect Monitor {
+ public pointcut handleEvent(Event event):
+ execution(* handleEvent(Event, ..)) && args(event);
+
+ public pointcut inHandleEvent(Event event): cflow(handleEvent(event));
+
+ before(Event event):
+ set(* currentView) &&
+ inHandleEvent(event) {
+ }
+
+}
diff --git a/tests/bugs152/pr145693/Sample.java b/tests/bugs152/pr145693/Sample.java
new file mode 100644
index 000000000..50f9cb334
--- /dev/null
+++ b/tests/bugs152/pr145693/Sample.java
@@ -0,0 +1,9 @@
+public class Sample {
+
+ private static Object currentView;
+
+ public static void main(String args[]) {
+ currentView = "test";
+ }
+
+}