Bug 532210

Summary: Should parameter annotations be considered only on the subject?
Product: [Tools] AspectJ Reporter: Andrew Clement <aclement>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 1.9.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Andrew Clement CLA 2018-03-08 18:54:04 EST
Currently when matching parameter annotations we look at every signature for a joinpoint. This can cause some unfortunate matches:

void foo(@Anno String s) {}

execution(* *(!Anno (*)))

Given that setup, it won't match. But if foo is overriding another method (e.g. implementing an interface method) then because the overridden method is likely:

void foo(String s) 

then the pointcut which match the overriding one. That is because a joinpoint can have many signatures, per:

https://eclipse.org/aspectj/doc/released/adk15notebook/jpsigs.html

Reviewing that page you can see that some elements of a signature must match on the subject of the join point (modifiers) whilst others can match if any signature for that joinpoint match.  The question then is whether parameter annotations should be treated like modifiers.