Bug 151593 - Provide public API to determine if a PointcutExpression tests based on runtime type of 'this'
Summary: Provide public API to determine if a PointcutExpression tests based on runtim...
Status: ASSIGNED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-24 11:15 EDT by Adrian Colyer CLA
Modified: 2013-06-24 11:05 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Colyer CLA 2006-07-24 11:15:27 EDT
In the weaver.tools API, there is no way to determine what runtime tests will be executed when a ShadowMatch returns maybeMatches(). Spring needs to know whether the this, target, @this, @target, or @annotation vars are part of the runtime test, because if so it can make an important optimisation in Spring AOP to say that the pointcut does not match. This is because the exact runtime type of a bean is already known - there can never be a subsitute subtype later on.  The Spring class org.springframework.aop.aspectj.RuntimeTestWalker contains an ugly workaround for AspectJ not providing this API. 

The smallest needed additional external API would be to add an operation

boolean matchConditionalOnRuntimeTypeOfThis() 

to the ShadowMatch interface.
Comment 1 Adrian Colyer CLA 2006-07-24 11:16:22 EDT
Spring code can be cleaned up once this enhancement is incorporated...
Comment 2 Eclipse Webmaster CLA 2007-07-29 09:20:39 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991
Comment 3 Andrew Clement CLA 2013-06-24 11:05:28 EDT
unsetting the target field which is currently set for something already released