diff options
author | aclement <aclement> | 2005-01-25 20:18:42 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-01-25 20:18:42 +0000 |
commit | 1b01255892ef222c14fea25b5db77208f1f6bb13 (patch) | |
tree | 6a18243250b6ff16573a1e8c7b46221de825a975 /tests/bugs150 | |
parent | 159d6bd9422fc8ab300cfb88280d7ef3bf910a95 (diff) | |
download | aspectj-1b01255892ef222c14fea25b5db77208f1f6bb13.tar.gz aspectj-1b01255892ef222c14fea25b5db77208f1f6bb13.zip |
Fix for Bug 83563: pertypewithin() handling of inner classes
Diffstat (limited to 'tests/bugs150')
-rw-r--r-- | tests/bugs150/PR83563_1.java | 23 | ||||
-rw-r--r-- | tests/bugs150/PR83563_2.java | 25 |
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/bugs150/PR83563_1.java b/tests/bugs150/PR83563_1.java new file mode 100644 index 000000000..834e450fe --- /dev/null +++ b/tests/bugs150/PR83563_1.java @@ -0,0 +1,23 @@ +public class PR83563_1 { + public static void main(String[] args) { + new NestedTest().run(); + int c = PertypewithinTest.aspectOf(PR83563_1.class).cnt; + if (c!=2) + throw new RuntimeException("Expected 2 advice executions: "+c); + } + + static class NestedTest implements Runnable { + public void run() { + System.out.println("Running..."); + } + } +} + +aspect PertypewithinTest pertypewithin(PR83563_1) { + public static int cnt = 0; + + before() : execution(* *.*(..)) { + cnt++; + System.out.println(thisJoinPointStaticPart); + } +} diff --git a/tests/bugs150/PR83563_2.java b/tests/bugs150/PR83563_2.java new file mode 100644 index 000000000..718f1f4d6 --- /dev/null +++ b/tests/bugs150/PR83563_2.java @@ -0,0 +1,25 @@ +public class PR83563_2 { + public void bar() { + new Runnable() { + public void run() { + System.out.println("Running..."); + } + }.run(); + } + + public static void main(String[] args) { + new PR83563_2().bar(); + int c = PertypewithinTest.aspectOf(PR83563_2.class).cnt; + if (c!=3) + throw new RuntimeException("Expected 3 advice executions but got:"+c); + } +} + +aspect PertypewithinTest pertypewithin(PR83563_2) { + public static int cnt = 0; + + before() : execution(* *.*(..)) { + cnt++; + System.out.println(thisJoinPoint); + } +} |