Project
IntelliJ IDEA
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Fixed
Assignee
Peter Gromov
Subsystem
J2EE.Spring
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   Taras Tielkes
    4 years ago (25 Sep 2007 22:58)
  • Updated by   root
    2 years ago (17 Jan 2010 20:53)
  • Jira: IDEADEV-21651
    (history, comments)
 
IDEA-41122 spring + aop: this() designator should be aware of declare-parents advice
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
The "declare-parents" type of advice can add additional interface implementations to a bean (a.k.a. "mix-ins").

In Spring AOP, the "this()" designator matches against the type of the _AOP proxy_.
So, when combining these two features, one can use this() to match mix-in interfaces added by declare-parents:
<aop:config>                                                                                                                                          
  <aop:aspect id="usageTrackerAspect" ref="simpleAspectBean">                                                                                         
    <aop:declare-parents types-matching="foo.bar.aop.SimpleTarget+" implement-interface="foo.bar.aop.MyMixin" 
                         default-impl="foo.bar.aop.MyMixinImpl"/>
    <aop:around pointcut="this(foo.bar.aop.MyMixin)" method="around"/>                                                                                
  </aop:aspect>                                                                                                                                       
</aop:config>


Above example works as expected, but IDEA shows "_This advice intercepts no methods_".
In practice above example is more often used in "binding form", with the around advice method having a MyMixin m parameter, and using "this(m) as pointcut.

Issue was resolved
Comments (1)
 
History
 
Linked Issues (?)
 
Irina Petrovskaya
  Irina Petrovskaya
12 Nov 2007 11:07
4 years ago
checked in 8014