aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/AroundCall.java
blob: 680f299c47f0dc819e68ea87c54e1c2ac8cb7f25 (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
25
26
27
28
import org.aspectj.testing.*;

public class AroundCall {
    void a(int nullm) { b(); }
    void b() { 
        Tester.check(false, "around failed");
    } 

    public static void main(String[] args) {
        AroundCall t = new AroundCall();
        t.a(42);
        Tester.checkAllEvents();
    }
    static {
        Tester.expectEvent("around");
    }
}

aspect TestAspect {
    /** @testcase PR#666 name binding in around cflow */
    void around(final int n) : // no bug if before advice
        cflow(execution(void AroundCall.a(int)) && args(n))  // no bug if no args
        && target(AroundCall) && !initialization(new(..))
        { 
            Tester.event("around");
            if (n > 100) proceed(n);  // some bugs hidden without call to proceed
        }
}