diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/CflowOfFieldInitAnonMethods.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/CflowOfFieldInitAnonMethods.java')
-rw-r--r-- | tests/new/CflowOfFieldInitAnonMethods.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/new/CflowOfFieldInitAnonMethods.java b/tests/new/CflowOfFieldInitAnonMethods.java new file mode 100644 index 000000000..1cfe6a2d0 --- /dev/null +++ b/tests/new/CflowOfFieldInitAnonMethods.java @@ -0,0 +1,46 @@ + +import org.aspectj.testing.Tester; + +/** @testcase PR#755 ajc dies on cflow into field init anon class */ +public class CflowOfFieldInitAnonMethods { + public static void main(String[] args) { + new CflowOfFieldInitAnonMethods().r.run(); // field initializer + // no bug on static field initializers or with non-anonymous class + // or when not calling another method + //XXX test should check, but that's for leter + //Tester.checkAllEvents(); + } + + Runnable r = new Runnable() { + public void run() { calc(1); } + public void calc(int i) {} + }; +} + +aspect ThreadTracer { + pointcut safe(): !within(ThreadTracer); + + before(): safe() && cflow(call(void Runnable.run())) { + Tester.event("before(): cflow(call(void Runnable.run()))"); + } + before(): safe() && cflowbelow(call(void Runnable.run())) { + Tester.event("before(): cflowbelow(call(void Runnable.run()))"); + } + before(): safe() && cflow(execution(void Runnable.run())) { + Tester.event("before(): cflow(execution(void Runnable.run()))"); + } + before(): safe() && cflowbelow(execution(void Runnable.run())) { + Tester.event("before(): cflowbelow(execution(void Runnable.run()))"); + } + before(): execution(void Runnable.run()) { // no bug here + Tester.event("before(): execution(void Runnable.run())"); + } + static { + Tester.expectEvent("before(): cflow(call(void Runnable.run()))"); + Tester.expectEvent("before(): cflowbelow(call(void Runnable.run()))"); + Tester.expectEvent("before(): cflow(execution(void Runnable.run()))"); + Tester.expectEvent("before(): cflowbelow(execution(void Runnable.run()))"); + Tester.expectEvent("before(): execution(void Runnable.run())"); + } +} + |