aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-18 09:01:17 +0000
committeraclement <aclement>2005-11-18 09:01:17 +0000
commitc7608950f0deb6f9951435f58209ad60aaf28e06 (patch)
treee4b74c727f2a678b0a2703b91258c458a70cd043 /tests/bugs150
parenta2fd71fc5098236847b6976ca49a731393cb0076 (diff)
downloadaspectj-c7608950f0deb6f9951435f58209ad60aaf28e06.tar.gz
aspectj-c7608950f0deb6f9951435f58209ad60aaf28e06.zip
test and fix for 116626 from Matthew.
Diffstat (limited to 'tests/bugs150')
-rw-r--r--tests/bugs150/pr116626/TestAspect.aj19
-rw-r--r--tests/bugs150/pr116626/aop.xml9
-rw-r--r--tests/bugs150/pr116626/com/foo/bar/Test.java28
3 files changed, 56 insertions, 0 deletions
diff --git a/tests/bugs150/pr116626/TestAspect.aj b/tests/bugs150/pr116626/TestAspect.aj
new file mode 100644
index 000000000..105a53eb9
--- /dev/null
+++ b/tests/bugs150/pr116626/TestAspect.aj
@@ -0,0 +1,19 @@
+package com.foo.bar;
+
+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.getObjs(Object[])) {
+
+ objs = proceed(mt, objs);
+ System.out.println("GO Aspects!");
+ return objs;
+ }
+}
diff --git a/tests/bugs150/pr116626/aop.xml b/tests/bugs150/pr116626/aop.xml
new file mode 100644
index 000000000..93ca6dd43
--- /dev/null
+++ b/tests/bugs150/pr116626/aop.xml
@@ -0,0 +1,9 @@
+<aspectj>
+ <aspects>
+ <aspect name="com.foo.bar.TestAspect"/>
+ </aspects>
+
+ <weaver options="-verbose -XlazyTjp -showWeaveInfo">
+ <include within="com.foo.*"/>
+ </weaver>
+</aspectj>
diff --git a/tests/bugs150/pr116626/com/foo/bar/Test.java b/tests/bugs150/pr116626/com/foo/bar/Test.java
new file mode 100644
index 000000000..5b255baee
--- /dev/null
+++ b/tests/bugs150/pr116626/com/foo/bar/Test.java
@@ -0,0 +1,28 @@
+package com.foo.bar;
+
+import java.util.*;
+
+public class Test<T> {
+
+ Set<T> intsSet;
+
+ public Test() {
+ this.intsSet = new HashSet<T>();
+ }
+
+ public <T> T[] getObjs(T[] a) {
+ return intsSet.toArray(a);
+ }
+
+ public static void main(String[] args) {
+ System.out.println("AAA :-)");
+ new TTT().foo();
+ }
+}
+
+class TTT {
+ public void foo() {
+ Test<Object> mt = new Test<Object>();
+ Object[] arr = mt.getObjs(new Object[]{});
+ }
+}