2
import org.aspectj.testing.Tester;
4
/** @testcase PR#755 ajc dies on cflow into field init anon class */
5
public class CflowOfFieldInitAnonMethods {
6
public static void main(String[] args) {
7
new CflowOfFieldInitAnonMethods().r.run(); // field initializer
8
// no bug on static field initializers or with non-anonymous class
9
// or when not calling another method
10
//XXX test should check, but that's for leter
11
//Tester.checkAllEvents();
14
Runnable r = new Runnable() {
15
public void run() { calc(1); }
16
public void calc(int i) {}
21
pointcut safe(): !within(ThreadTracer);
23
before(): safe() && cflow(call(void Runnable.run())) {
24
Tester.event("before(): cflow(call(void Runnable.run()))");
26
before(): safe() && cflowbelow(call(void Runnable.run())) {
27
Tester.event("before(): cflowbelow(call(void Runnable.run()))");
29
before(): safe() && cflow(execution(void Runnable.run())) {
30
Tester.event("before(): cflow(execution(void Runnable.run()))");
32
before(): safe() && cflowbelow(execution(void Runnable.run())) {
33
Tester.event("before(): cflowbelow(execution(void Runnable.run()))");
35
before(): execution(void Runnable.run()) { // no bug here
36
Tester.event("before(): execution(void Runnable.run())");
39
Tester.expectEvent("before(): cflow(call(void Runnable.run()))");
40
Tester.expectEvent("before(): cflowbelow(call(void Runnable.run()))");
41
Tester.expectEvent("before(): cflow(execution(void Runnable.run()))");
42
Tester.expectEvent("before(): cflowbelow(execution(void Runnable.run()))");
43
Tester.expectEvent("before(): execution(void Runnable.run())");