blob: 63568aa3c9f61cfcd62ee926efe6d9f71d2277f5 (
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
|
import org.aspectj.testing.Tester;
public class PointcutQualification2 {
public static void main(String[] args) {
Tester.expectEvent("before pc_reference2");
new TargetClass().doit();
Tester.checkAllEvents();
}
}
class I {
public static final void got(String s) {
Tester.event(s);
}
}
class TargetClass{ void doit(){}}
aspect DebugAspect2 { // incorrect compiler error here
before() : Aspect2.pc_reference2() { I.got("before pc_reference2");}
}
aspect Aspect2 {
pointcut pc_notfound2()
: execution(void TargetClass.doit()) ;
//pointcut anotherRef() : Aspect2.pc_notfound2(); // workaround
pointcut anotherRef() : pc_notfound2();
pointcut pc_reference2() : anotherRef();
}
|