summaryrefslogtreecommitdiffstats
path: root/tests/bugs1612
diff options
context:
space:
mode:
authoraclement <aclement>2011-03-23 16:22:44 +0000
committeraclement <aclement>2011-03-23 16:22:44 +0000
commit0ff946aff9ce150707a375437fe7270a5095792f (patch)
tree7ccae226db59f4fc51ae29c6dc6fe98dffd3074c /tests/bugs1612
parentdf25267806381e84bdf17ab25ef88b28e7f3abc2 (diff)
downloadaspectj-0ff946aff9ce150707a375437fe7270a5095792f.tar.gz
aspectj-0ff946aff9ce150707a375437fe7270a5095792f.zip
1.6.12 infra + 292239
Diffstat (limited to 'tests/bugs1612')
-rw-r--r--tests/bugs1612/pr292239/Code.java30
-rw-r--r--tests/bugs1612/pr292239/Code2.java34
2 files changed, 64 insertions, 0 deletions
diff --git a/tests/bugs1612/pr292239/Code.java b/tests/bugs1612/pr292239/Code.java
new file mode 100644
index 000000000..cbdfd3d50
--- /dev/null
+++ b/tests/bugs1612/pr292239/Code.java
@@ -0,0 +1,30 @@
+package mypackage;
+
+import javax.management.MXBean;
+
+aspect Azpect {
+
+ pointcut pc(Object o) : this(o) && execution(* (Code).n*(..));
+
+ after(Object o) throwing(Exception e) : pc(o) {
+ System.out.println("caught it");
+// e.printStackTrace();
+ }
+
+}
+
+public class Code {
+
+ // anotherCaughtMethod is NOT advised -- <<< ERROR <<< this should be advised
+ public void n() { throw new RuntimeException("n"); }
+
+ public static void main(String[]argv) {
+ try {
+ new Code().n();
+ } catch (Exception e) {
+
+ }
+ System.out.println("done");
+ }
+
+}
diff --git a/tests/bugs1612/pr292239/Code2.java b/tests/bugs1612/pr292239/Code2.java
new file mode 100644
index 000000000..93356d327
--- /dev/null
+++ b/tests/bugs1612/pr292239/Code2.java
@@ -0,0 +1,34 @@
+package mypackage;
+
+aspect Azpect {
+
+ pointcut pc(Object o) : this(o) && execution(* Code2.n*(..) throws Exception+);
+
+ after(Object o) throwing(Exception e) : pc(o) {
+ System.out.println("caught it: "+thisJoinPointStaticPart);
+ }
+
+}
+
+public class Code2 {
+
+
+ public void n1() { throw new RuntimeException("n"); }
+ public void n2() throws MyException { throw new MyException(); }
+
+ public static void main(String[]argv) {
+ try {
+ new Code2().n1();
+ } catch (Exception e) {}
+ try {
+ new Code2().n2();
+ } catch (Exception e) {}
+ System.out.println("done");
+ }
+
+}
+
+class MyException extends Exception {
+
+
+} \ No newline at end of file