Bug 106166 - Allow Multiple Bindings & Binding in Negation
Summary: Allow Multiple Bindings & Binding in Negation
Status: REOPENED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-05 11:10 EDT by Ron Bodkin CLA
Modified: 2009-08-30 02:50 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2005-08-05 11:10:41 EDT
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).
Comment 1 Adrian Colyer CLA 2005-08-26 11:42:50 EDT
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.
Comment 2 Ron Bodkin CLA 2006-04-10 01:25:53 EDT
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);
Comment 3 Eclipse Webmaster CLA 2009-08-30 02:50:49 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.