summaryrefslogtreecommitdiffstats
path: root/tests/new/PR347.java
blob: e7479938f7671b92cc73849e6fd18377bb6310cb (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
32
33
34
35
36
37
import org.aspectj.testing.*;

public class PR347 {
    public static void main(String[] args) {
        new PR347().realMain(args);
    }
    public void realMain(String[] args) {
        new A().i();
        new B().j();
        Tester.checkAllEvents();
    }
    static {
        Tester.expectEventsInString("Ai,A.i,Bj,B.j");
    }
}
interface I { public void i(); }
interface J { public void j(); }

class A {}
class B {}

aspect Aspect1 {
    A +implements I;
    B +implements J;
}

aspect Aspect2 {
    pointcut Ai(): receptions(void i()) && instanceof(A);
    pointcut Bj(): receptions(void j()) && instanceof(B);
    before(): Ai() { Tester.event("Ai"); }
    before(): Bj() { Tester.event("Bj"); }
}

aspect Aspect3 {
    public void A.i() { Tester.event("A.i"); }
    public void B.j() { Tester.event("B.j"); }
}