diff options
author | jhugunin <jhugunin> | 2004-01-09 09:21:03 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2004-01-09 09:21:03 +0000 |
commit | 7b081f2e0bece3414ac4f385cde75d7b54981099 (patch) | |
tree | 7c8b7d35d7e84fc1666f6813c30d8cf3520bcb9a /tests/bugs | |
parent | 8d29495e512cf88357f43a044ec515506bca2768 (diff) | |
download | aspectj-7b081f2e0bece3414ac4f385cde75d7b54981099.tar.gz aspectj-7b081f2e0bece3414ac4f385cde75d7b54981099.zip |
Fix for Bugzilla Bug 49638 exception logging: after() throwing advice can't convert Throwable obj to string and ajc aborts
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/AfterThrowingAdviceSyntaxError.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/bugs/AfterThrowingAdviceSyntaxError.java b/tests/bugs/AfterThrowingAdviceSyntaxError.java new file mode 100644 index 000000000..088dcdc9a --- /dev/null +++ b/tests/bugs/AfterThrowingAdviceSyntaxError.java @@ -0,0 +1,28 @@ +import org.aspectj.lang.*; + +public class AfterThrowingAdviceSyntaxError { + + public static void main(String[] args) { + perform(); + } + + private static void perform() { + Object nullObj = null; + nullObj.toString(); + } +} + +aspect ExceptionLoggerAspectV2 +{ + + pointcut exceptionLogMethods() + : call(* *.*(..)) && !within(ExceptionLoggerAspectV2); + + after() thowing(Throwable ex) : exceptionLogMethods() { + Signature sig = thisJoinPointStaticPart.getSignature(); + System.out.printl("WARNING: " + + sig.getDeclaringType().getName() + " " + + sig.getName() + " " + + "Exception logger aspect " + ex); + } +}
\ No newline at end of file |