Bug 532210 - Should parameter annotations be considered only on the subject?
Summary: Should parameter annotations be considered only on the subject?
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.9.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-08 18:54 EST by Andrew Clement CLA
Modified: 2018-03-08 18:54 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.