diff options
author | acolyer <acolyer> | 2005-09-29 11:30:49 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-29 11:30:49 +0000 |
commit | d6256b8c3c944d8fa2feb6d837900144db6521ac (patch) | |
tree | 7159397e5b613f953c1faae0b1494314cb5bc6a4 /tests/bugs150/pr100195.aj | |
parent | c5171f738fcfa0cc947b2be45e00af8b78d7ac7d (diff) | |
download | aspectj-d6256b8c3c944d8fa2feb6d837900144db6521ac.tar.gz aspectj-d6256b8c3c944d8fa2feb6d837900144db6521ac.zip |
tests and fix for pr100195, local var debug info not preserved when inlining around advice
Diffstat (limited to 'tests/bugs150/pr100195.aj')
-rw-r--r-- | tests/bugs150/pr100195.aj | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/bugs150/pr100195.aj b/tests/bugs150/pr100195.aj new file mode 100644 index 000000000..816711e89 --- /dev/null +++ b/tests/bugs150/pr100195.aj @@ -0,0 +1,62 @@ +import org.aspectj.testing.Tester; + +public class pr100195 { + public static void main(String[] args) { + new Foo().foo(); + AroundCasting.main(new String[0]); + } +} + +class Foo { + + static int x; + + private String myString = "A String"; + + public static void main(String[] args) { + new Foo().foo(); + AroundCasting.main(new String[0]); + } + + public void foo() { + String myLocal = myString; + x = 5; + System.out.println(myLocal); // breakpoint here + bar(x); + } + + public void bar(int y) {} +} +// Test.aj +aspect Test { + void around() : ( execution(* Foo.foo(..) ) ) { + int y = 4; + System.out.println("before"); + proceed(); + System.out.println("after"); + } +} + +class AroundCasting { + public static void main(String[] args) { + bar(x); + //Tester.checkEqual(x, 1003); + } + static int x; + + static void bar(int y) {} +} + + +aspect A { + static boolean test() { return true; } + + int around(): if (test()) && get(int AroundCasting.x) { + return proceed() + 1000; + } + + void around(): execution(void AroundCasting.main(String[])) { + Tester.event("enter main"); + proceed(); + } +} |