aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-03 10:31:03 +0000
committeraclement <aclement>2005-11-03 10:31:03 +0000
commit4b5e76347445be5180616f5008e52328948b6cf5 (patch)
treec8a734eb911a4ea1d4b5924290d9b51f86223825 /tests/bugs150
parentade32bc38c17b38811b617f54828feb43a4b7048 (diff)
downloadaspectj-4b5e76347445be5180616f5008e52328948b6cf5.tar.gz
aspectj-4b5e76347445be5180616f5008e52328948b6cf5.zip
fix for latest variant of 114343 (see comment #5): around advice on method returning type variable.
Diffstat (limited to 'tests/bugs150')
-rw-r--r--tests/bugs150/pr114343/case2/TTT.java11
-rw-r--r--tests/bugs150/pr114343/case2/Test.java11
-rw-r--r--tests/bugs150/pr114343/case2/TestAspect.java25
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/bugs150/pr114343/case2/TTT.java b/tests/bugs150/pr114343/case2/TTT.java
new file mode 100644
index 000000000..732e0d38e
--- /dev/null
+++ b/tests/bugs150/pr114343/case2/TTT.java
@@ -0,0 +1,11 @@
+import java.util.*;
+
+public class TTT {
+ public void foo() {
+ System.err.println("Creating Test<Integer> instance");
+ Test<Integer> mt = new Test<Integer>();
+ System.err.println("Calling toArray");
+ Integer[] arr = mt.toArray(new Integer[]{});
+ System.err.println("done");
+ }
+}
diff --git a/tests/bugs150/pr114343/case2/Test.java b/tests/bugs150/pr114343/case2/Test.java
new file mode 100644
index 000000000..758094997
--- /dev/null
+++ b/tests/bugs150/pr114343/case2/Test.java
@@ -0,0 +1,11 @@
+import java.util.*;
+
+public class Test<T> {
+
+ Set<T> set = new HashSet<T>();
+
+ public <T> T[] toArray(T[] a) {
+ System.err.println("In toArray()");
+ return set.toArray(a);
+ }
+}
diff --git a/tests/bugs150/pr114343/case2/TestAspect.java b/tests/bugs150/pr114343/case2/TestAspect.java
new file mode 100644
index 000000000..fcc760ac7
--- /dev/null
+++ b/tests/bugs150/pr114343/case2/TestAspect.java
@@ -0,0 +1,25 @@
+import java.util.*;
+
+public privileged aspect TestAspect {
+
+ pointcut TestToArray(Test mt) :
+ target(mt) &&
+ !within(TestAspect);
+
+
+ Object[] around(Test mt, Object[] objs) :
+ TestToArray(mt) &&
+ args(objs) &&
+ execution(Object[] Test.toArray(Object[])) {
+
+ System.err.println("In around advice");
+ objs = proceed(mt, objs);
+ return objs;
+ }
+
+ public static void main(String[] argv) {
+ System.err.println("TestAspect.main: Calling foo");
+ new TTT().foo();
+ System.err.println("TestAspect.main: done");
+ }
+}