aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs152
diff options
context:
space:
mode:
authoraclement <aclement>2006-04-21 17:55:11 +0000
committeraclement <aclement>2006-04-21 17:55:11 +0000
commit5b354c21ff2b4754522f75324f8094958804a753 (patch)
tree041370ac8de806c3c40bf48ff86bafccbe28de65 /tests/bugs152
parent1535ee721c16509713642e20316b226ece69fda9 (diff)
downloadaspectj-5b354c21ff2b4754522f75324f8094958804a753.tar.gz
aspectj-5b354c21ff2b4754522f75324f8094958804a753.zip
testcode for 137496: problem with join point matching on calls to parameterized methods
Diffstat (limited to 'tests/bugs152')
-rw-r--r--tests/bugs152/pr137496/B.java28
-rw-r--r--tests/bugs152/pr137496/D.java28
-rw-r--r--tests/bugs152/pr137496/E.java24
-rw-r--r--tests/bugs152/pr137496/F.java24
-rw-r--r--tests/bugs152/pr137496/G.java24
5 files changed, 128 insertions, 0 deletions
diff --git a/tests/bugs152/pr137496/B.java b/tests/bugs152/pr137496/B.java
new file mode 100644
index 000000000..5351ed327
--- /dev/null
+++ b/tests/bugs152/pr137496/B.java
@@ -0,0 +1,28 @@
+interface P<T> {
+ public T pm(T t);
+// public String pm2(String t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+// public String pm2(String s) { return s;}
+}
+
+public class B {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+// test.pm2("foo");
+ }
+}
+
+aspect X {
+ before(): call(* pm(..)) { System.err.println("advice");}
+// before(): call(* pm2(..)) {}
+} \ No newline at end of file
diff --git a/tests/bugs152/pr137496/D.java b/tests/bugs152/pr137496/D.java
new file mode 100644
index 000000000..db6cad514
--- /dev/null
+++ b/tests/bugs152/pr137496/D.java
@@ -0,0 +1,28 @@
+interface P<T> {
+ public T pm(T t);
+ public String pm2(String t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+ public String pm2(String s) { System.err.println(s);return s;}
+}
+
+public class D {
+
+ public static void main(String []argv) {
+ CImpl test = new CImpl();
+ test.pm("foo"); // manifests as 'String pm(String) call' due to type CImpl being used
+ test.pm2("foo");
+ }
+}
+
+aspect X {
+ before(): call(* pm(..)) { System.err.println("advice");}
+ before(): call(* pm2(..)) { System.err.println("advice2");}
+} \ No newline at end of file
diff --git a/tests/bugs152/pr137496/E.java b/tests/bugs152/pr137496/E.java
new file mode 100644
index 000000000..2abfed94d
--- /dev/null
+++ b/tests/bugs152/pr137496/E.java
@@ -0,0 +1,24 @@
+interface P<T> {
+ public T pm(T t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+}
+
+public class E {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+ }
+}
+
+aspect X {
+ before(): call(* pm(String)) { System.err.println("advice");} // matches?
+} \ No newline at end of file
diff --git a/tests/bugs152/pr137496/F.java b/tests/bugs152/pr137496/F.java
new file mode 100644
index 000000000..6960646aa
--- /dev/null
+++ b/tests/bugs152/pr137496/F.java
@@ -0,0 +1,24 @@
+interface P<T> {
+ public T pm(T t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+}
+
+public class F {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+ }
+}
+
+aspect X {
+ before(): call(String pm(..)) { System.err.println("advice");} // matches?
+} \ No newline at end of file
diff --git a/tests/bugs152/pr137496/G.java b/tests/bugs152/pr137496/G.java
new file mode 100644
index 000000000..fd566dfe5
--- /dev/null
+++ b/tests/bugs152/pr137496/G.java
@@ -0,0 +1,24 @@
+interface P<T> {
+ public T pm(T t);
+}
+
+interface C extends P<String> {
+ public void cm();
+}
+
+class CImpl implements C {
+ public void cm() {}
+ public String pm(String s) { System.err.println(s);return s;}
+}
+
+public class G {
+
+ public static void main(String []argv) {
+ C test = new CImpl();
+ test.pm("foo"); // manifests as 'Object pm(Object) call' due to type C being used
+ }
+}
+
+aspect X {
+ before(): call(* pm(Object)) { System.err.println("advice");} // no match...
+} \ No newline at end of file