blob: 37be4f1ffd7587dc3fb1f6b4ce3e1cedf620dbc2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import org.aspectj.lang.reflect.*;
public aspect ReferencePointcuts {
pointcut pc1() : call(* *.*(..));
pointcut pc2() : pc1() || execution(* *.*(..));
public static void main(String[] args) throws NoSuchPointcutException {
AjType myType = AjTypeSystem.getAjType(ReferencePointcuts.class);
Pointcut p1 = myType.getDeclaredPointcut("pc1");
if (!p1.getPointcutExpression().toString().equals("call(* *(..))"))
throw new RuntimeException("unexpected pc expression: " + p1.getPointcutExpression());
Pointcut p2 = myType.getDeclaredPointcut("pc2");
if (!p2.getPointcutExpression().toString().equals("(pc1() || execution(* *(..)))"))
throw new RuntimeException("unexpected pc expression: " + p2.getPointcutExpression());
}
}
|