aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/AroundCasting.java
blob: cabb04a39d7d82a4d9f7ec5d955e5724b4735580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import org.aspectj.testing.Tester;

public class AroundCasting {
    public static void main(String[] args) {
        Tester.checkEqual(x = 3, 3);
        Tester.checkEqual(x, 1003);
        Tester.checkEvents(new String[] { "enter main" });
    }
    static int x;
}


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();
    }
}