diff options
author | acolyer <acolyer> | 2004-01-07 16:41:51 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-01-07 16:41:51 +0000 |
commit | 14a4edf940514c83c60f055c3cf409d1ce8db399 (patch) | |
tree | ca986d5409d8704e99a3b8aa6925be577c1c938e /tests/bugs/GetCauseOnSoftException.java | |
parent | ed48480aba7384dbf996b09e67010cdb86fa08c4 (diff) | |
download | aspectj-14a4edf940514c83c60f055c3cf409d1ce8db399.tar.gz aspectj-14a4edf940514c83c60f055c3cf409d1ce8db399.zip |
pr 48522
Diffstat (limited to 'tests/bugs/GetCauseOnSoftException.java')
-rw-r--r-- | tests/bugs/GetCauseOnSoftException.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/bugs/GetCauseOnSoftException.java b/tests/bugs/GetCauseOnSoftException.java new file mode 100644 index 000000000..125fce88c --- /dev/null +++ b/tests/bugs/GetCauseOnSoftException.java @@ -0,0 +1,32 @@ + +import org.aspectj.lang.*; + +public class GetCauseOnSoftException { + + public static void a(){ + b(); + } + /** + * Method b. + */ + private static void b() { + throw new MyException("secret"); + } + + public static void main(String[] args) { + try { + a(); + } catch (SoftException e) { + System.out.println(e.getCause()); + if (e.getCause().getMessage().indexOf("secret")==-1) + throw new RuntimeException("Didn't get expected cause of SoftException"); + } + } +} +aspect Softner { + declare soft : MyException : within(GetCauseOnSoftException); +} + +class MyException extends Exception { + MyException(String s) { super(s);} +}
\ No newline at end of file |