blob: 396942824a3d59af47b5467c3250900d64c1c5e1 (
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
|
// Bind the target but forget to pass it on the proceed call
aspect X2 {
void around(M t,String p): call(void M.method(String)) && args(p) && target(t) {
System.err.println("advice from code aspect");
proceed( "faked" ); // X2.java:7 [error] too few arguments to proceed, expected 2
}
public static void main(String []argv) {
M.main(argv);
}
}
class M {
String prefix;
public M(String prefix) { this.prefix = prefix; }
public static void main( String[] args ) {
M m = new M(">");
m.method("real");
}
public void method(String s) { System.err.println(s); }
}
|