blob: ffa696dfa6d75d48429b3b3299d6720413a640c5 (
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
|
import java.util.*;
/**
* PR#479
* A variant of Hunter Kelly's bug PR#479. This
* doesn't get his desired, but should compile.
*/
public class BindingArgumentsInWithincode {
public static void main(String[] args) {
org.aspectj.testing.Tester.check(true, "compiled");
}
}
class C {
public void someMethod(String s) {
new ArrayList().add(s+":"+s);
}
}
aspect A {
pointcut top(String s):
withincode(void someMethod(String)) && args(s);
pointcut method(Object o):
call(* java.util.List.add(Object)) && args(o);
/*
* Won't capture what we're after
* but it should compile
*/
before(String s, Object o): top(s) && method(o) {}
}
|