blob: bb3140cd77cfab5542d3136db95ed70b1b959da2 (
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
38
39
40
41
42
43
|
import org.aspectj.compiler.base.ast.*;
public class CallsVRec {
public static void main(String[] args) {
new CallsVRec().realMain(args);
}
public void realMain(String[] args) {
org.aspectj.testing.Tester.check(true, "Compiled!");
}
public CallsVRec() {
}
}
aspect Wins {
pointcut showError(ASTObject ast, String msg):
target(ast)
&& call(void ASTObject.showError(String))
&& args(msg);
void around(ASTObject ast, String msg): showError(ast, msg) {
System.out.println("hi");
proceed(ast, msg);
}
}
aspect Loses {
pointcut showError(ASTObject ast, String msg):
target(ast)
&& call/*s*/(void ASTObject.showError(String))
&& args(msg);
void around(ASTObject ast, String msg): showError(ast, msg) {
System.out.println("hi");
proceed(ast, msg);
}
}
|