diff options
author | jhugunin <jhugunin> | 2004-01-14 15:24:06 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2004-01-14 15:24:06 +0000 |
commit | 5834de97836ebcc056415736c17c46e8b1dfaf5a (patch) | |
tree | a7b87ccc35e25aafe73d24d17f08cc33f62b22c4 /tests/new | |
parent | 7bbd1f419239dc9e8b46e7fd912b2bc007bbd76a (diff) | |
download | aspectj-5834de97836ebcc056415736c17c46e8b1dfaf5a.tar.gz aspectj-5834de97836ebcc056415736c17c46e8b1dfaf5a.zip |
Fix for Bugzilla Bug 44587
Erroneous exception conversion
and Bugzilla Bug 34206
before():execution(new(..)) does not throw NoAspectBoundException
All exceptions that occur during the static intialization of a persingleton
aspect will be swallowed. When using that aspect (via aspectOf())
a NoAspectBoundException will be thrown with the original exception
from the staitc initializer as the cause.
Diffstat (limited to 'tests/new')
-rw-r--r-- | tests/new/ConstructorExecInitFails.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/new/ConstructorExecInitFails.java b/tests/new/ConstructorExecInitFails.java index 4b5e775e4..e042f10ff 100644 --- a/tests/new/ConstructorExecInitFails.java +++ b/tests/new/ConstructorExecInitFails.java @@ -1,4 +1,5 @@ import org.aspectj.testing.*; +import org.aspectj.lang.*; /** * -usejavac mode: no error @@ -8,7 +9,10 @@ public class ConstructorExecInitFails { public static void main(String[] args) { try { new ConstructorExecInitFails(); - } catch (ExceptionInInitializerError e) { + } catch (NoAspectBoundException e) { + + Tester.check(e.getCause() instanceof NoAspectBoundException, + "Expected NoAspectBoundException, found " + e.getCause()); return; } Tester.checkFailed("shouldn't be able to run"); |