Community
Participate
Working Groups
Hi all, the simple pointcut definition below does not compile, as the compiler claims the binding of the this-argument is ambiguous. However, this binding is sound, reference theRefObj is bound to exactly one variable in each case. Error message is: "Ambiguous binding of type PointcutBinding using args(..) at this line - formal is already bound. See secondary source location for location of args(..)". public aspect PointcutBinding { public void method_1(String arg2) { System.out.println("method1:String"); } public void method_2(PointcutBinding rep, String arg2) { System.out.println("method2:PointcutBinding, String"); } public pointcut _pc(String aParameter, PointcutBinding theRefObj) : (execution (public void method_1(String)) && args(aParameter) && this(theRefObj)) || (execution (public void method_2(PointcutBinding, String)) && args(theRefObj, aParameter) && this(PointcutBinding)); before(String arg1, PointcutBinding refObj) : _pc(arg1, refObj) { System.out.println("advice"); } } Best regards,
Confirmed fixed by the pointcut rewriter in AspectJ5. the binding behaves as expected.