diff options
Diffstat (limited to 'tests/new/BindingArgumentsInWithincode.java')
-rw-r--r-- | tests/new/BindingArgumentsInWithincode.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/new/BindingArgumentsInWithincode.java b/tests/new/BindingArgumentsInWithincode.java new file mode 100644 index 000000000..ffa696dfa --- /dev/null +++ b/tests/new/BindingArgumentsInWithincode.java @@ -0,0 +1,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) {} +} |