Community
Participate
Working Groups
It would be helpful to allow binding the same value more than once in a pointcut. This should match only if the value is the same in all clauses and might require a runtime check. For example: pointcut callSelf(Object o): call(* *(..)) && this(o) && target(o); It would also then be useful to be able to reference a value that is already bound in a pointcut in a negation clause, i.e., binding in negation would be reasonable as long as there's a bound value that's not negated: pointcut execOnThis(Object o) : execution(* *(..)) && this(o); pointcut topLevelExecOnThis(Object o) : execOnThis(o) && !cflowbelow(execOnThis(o)); The motivation for this latter pointcut is to let me capture the execution of a method (like show) only once even if it is dispatching to the superclass implementation, but to still capture executions of the same method on different instances in the same cflow. A workaround is to match on calls (but that isn't always feasible).
We're not going to get to this in AJ 1.5.0. Marking as "LATER" for consideration in 1.5.1 and future release planning.
A similar useful idiom would be: aspect Track perthis(trackCtor()) { List tracked; pointcut modifyFieldCalls() : modifyCalls() && target(tracked); ... } Today you need: pointcut modifyFieldCalls(List bound) : modifyCalls() && target(bound) && if (tracked==bound);
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.