Community
Participate
Working Groups
The below code is a simplification of an event listener style poincut interface: (See below for a description of the bug itself.) public class AnyoneListening { public static void main(String[] args) { AnyoneListening a = new AnyoneListening(); Util u = new Util(); a.doStuff(u); } public void doStuff(Util u) { notifyUtilUsed(u); } private void notifyUtilUsed(Util u) {/*intentionally left blank*/} public pointcut utilUsed(AnyoneListening al, Util u): this(al) && args(u) && execution(void AnyoneListening.doStuff (Util)); private void notifyUtilLookedAt(Util u) {/*intentionally left blank*/} public pointcut utilLookedAt(AnyoneListening al, Util u): execution(void AnyoneListening.notifyUtilLookedAt(Util)) && this(al) && args(u); public pointcut utilTouched(AnyoneListening al, Util u): utilUsed(al, u) || utilLookedAt(al, u); } class Util { } aspect Observer { before(AnyoneListening al, Util u): AnyoneListening.utilTouched(al, u) { System.out.println("Someone used it"); } } ////////////////// This code compiles fine with ajc 1.1.1, but under 1.2 I get the following error message: Ambiguous binding of type Util using args(..) at this line. Use one args(..) per matched join point, see secondary source location for location of extraneous args(..). It worked in 1.1.1, and supposedly 1.2 didn't change the semantics of the language, thus I file. :-)
I'll just point out the bug that caused the introduction of this new message, bug 61568.
pointcut rewriting in AspectJ5 means the program compiles fine now.