aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/handlers/ExceptionCheckCE.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-05-21 00:37:47 +0000
committerwisberg <wisberg>2003-05-21 00:37:47 +0000
commitdb2886b91cdf010e729f5be3210b5abcfe73e4f0 (patch)
tree10351f70e6dc8edb8a794f909713eaaece1732fe /tests/bugs/handlers/ExceptionCheckCE.java
parentfad36b98aaef028c7678206f89a0e8178b360030 (diff)
downloadaspectj-db2886b91cdf010e729f5be3210b5abcfe73e4f0.tar.gz
aspectj-db2886b91cdf010e729f5be3210b5abcfe73e4f0.zip
@testcase PR#37898 advice on handler join points should not throw unpermitted checked exceptions
Diffstat (limited to 'tests/bugs/handlers/ExceptionCheckCE.java')
-rw-r--r--tests/bugs/handlers/ExceptionCheckCE.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/bugs/handlers/ExceptionCheckCE.java b/tests/bugs/handlers/ExceptionCheckCE.java
new file mode 100644
index 000000000..476b2adec
--- /dev/null
+++ b/tests/bugs/handlers/ExceptionCheckCE.java
@@ -0,0 +1,30 @@
+
+
+public class ExceptionCheckCE {
+
+ void go() {
+ try {
+ String s = new String("hello");
+ } catch (RuntimeException e) { // CW 8: pointcut works, but can't throw Exceptions
+ // body of handler here
+ if (null == e) {
+ throw new Error("never happens");
+ }
+ }
+ }
+}
+
+/** @testcase PR#37898 advice on handler join points should not throw unpermitted checked exceptions */
+aspect A {
+
+ pointcut goHandler() :
+ handler(RuntimeException) && withincode(void go());
+
+ declare warning : goHandler() : "expected warning"; // just verifying pointcut
+
+ before() throws Exception : goHandler() { // CE 25 can't throw from handler
+ throw new Exception("bad");
+ }
+
+}
+ \ No newline at end of file