aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/TryOffEnd.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/new/TryOffEnd.java')
-rw-r--r--tests/new/TryOffEnd.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/new/TryOffEnd.java b/tests/new/TryOffEnd.java
new file mode 100644
index 000000000..c2b0c166c
--- /dev/null
+++ b/tests/new/TryOffEnd.java
@@ -0,0 +1,25 @@
+
+import org.aspectj.testing.Tester;
+
+/** @testcase VerifyError after around advice falls off end of tryCatch */
+public class TryOffEnd {
+ public static void main(String[] args) {
+ Tester.check(new TryOffEnd().error(), "functional failure");
+ }
+ public boolean error() {
+ String s = null;
+ try {
+ s = System.getProperty("unknown Property");
+ } catch (Throwable t) { // CW 13 cannot apply advice
+ t.printStackTrace(System.err);
+ }
+ return true;
+ }
+}
+
+aspect A {
+ Object around() : within(TryOffEnd) && handler(Throwable) { // CW 21 cannot apply advice
+ Object result = proceed();
+ return result;
+ }
+}