From d15eb325fc77d9f1eb0ac9ec1f6886562d531105 Mon Sep 17 00:00:00 2001 From: jhugunin Date: Thu, 13 Feb 2003 22:00:34 +0000 Subject: fixed Bug 30168: bad optimization of thisJoinPoint to thisJoinPointStaticPart --- tests/ajcTests.xml | 7 +++++++ tests/ajcTestsFailing.xml | 6 ------ tests/bugs/crashes/test/Test3.java | 38 ++++++++++++++++++++++++++++++++++++++ tests/jimTests.xml | 3 --- 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 tests/bugs/crashes/test/Test3.java (limited to 'tests') diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 1d0501dd6..15864594a 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -5566,4 +5566,11 @@ + + + + + + diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 4bdd8def6..6543e9b02 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -51,11 +51,5 @@ - - - - - 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); + } +} diff --git a/tests/jimTests.xml b/tests/jimTests.xml index 0a867d719..e7e9b8b97 100644 --- a/tests/jimTests.xml +++ b/tests/jimTests.xml @@ -1,9 +1,6 @@ - - -