aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/AdviceExec.java
blob: 7d28f28fe2a01d534d72cf3e05d20c44439810d4 (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
29
30
31
// for Bug#:  31423  
import org.aspectj.testing.Tester;


public class AdviceExec {
    public static void main(String[] args) {
    	Tester.checkEqual(Aspect1.ran, 2, "Aspect1 ran");
    	Tester.checkEqual(Aspect2.ran, 2, "Aspect2 ran");
    }
}

aspect Aspect1 {
	static int ran = 0;
    before() : execution(* AdviceExec.*(..)) {
		//System.out.println("Reached " + thisJoinPoint);
		ran++;
    }
    
    void around(): execution(* AdviceExec.*(..)) {
    	ran++;
    	proceed();
    }
}

aspect Aspect2 {
	static int ran = 0;
    before() : adviceexecution() && !within(Aspect2) {
		//System.out.println("Reached " + thisJoinPoint);
		ran++;
    }
}