summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-02-13 22:00:34 +0000
committerjhugunin <jhugunin>2003-02-13 22:00:34 +0000
commitd15eb325fc77d9f1eb0ac9ec1f6886562d531105 (patch)
tree5c20d3a4d08a8490784fbb422d64dd69faeabc92 /tests/bugs
parent3e2801ad504e8f6b3fa7b50a42bf2706994e1727 (diff)
downloadaspectj-d15eb325fc77d9f1eb0ac9ec1f6886562d531105.tar.gz
aspectj-d15eb325fc77d9f1eb0ac9ec1f6886562d531105.zip
fixed Bug 30168: bad optimization of thisJoinPoint to thisJoinPointStaticPart
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/crashes/test/Test3.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/bugs/crashes/test/Test3.java b/tests/bugs/crashes/test/Test3.java
new file mode 100644
index 000000000..e2d6aa474
--- /dev/null
+++ b/tests/bugs/crashes/test/Test3.java
@@ -0,0 +1,38 @@
+package test;
+import org.aspectj.lang.*;
+import org.aspectj.lang.reflect.*;
+
+public class Test3 {
+ public static void main(String[] args) throws Exception {
+ Test3 a = new Test3();
+ a.foo(-3);
+ }
+ public void foo(int i) {
+ this.x=i;
+ }
+ int x;
+}
+
+aspect Log {
+ pointcut assign(Object newval, Object targ):
+ set(* test..*) && args(newval) && target(targ);
+
+
+ before(Object newval, Object targ): assign(newval,targ) {
+ Signature sign = thisJoinPoint.getSignature();
+ System.out.println(targ.toString() + "." + sign.getName() + ":=" + newval);
+ }
+ /*
+}
+// Different error message if you divide into two aspects
+aspect Tracing {
+ */
+ pointcut tracedCall():
+ call(* test..*(..))/* && !within(Tracing)*/ && !within(Log);
+
+ after() returning (Object o): tracedCall() {
+ // Works if you comment out either of these two lines
+ thisJoinPoint.getSignature();
+ System.out.println(thisJoinPoint);
+ }
+}