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:
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.
Description
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:
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.