AOP PointCuts: ProceedingJointPoint provides the synthetic(bridge) and not the real method [SPR-5317] #9990
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Liam Knox opened SPR-5317 and commented
I am not sure whether you determine this as a bug, though it seems both counter intuitive and undocumented
If you point cut a certain method you will not always get the underlying method as part of the ProceedingJointPoint, you may instead get the synthetic(bridge) method,
For example
@CutHere
void myMethod(@MyParam
param);Depend on the context of usage ( i.e. Generic )
Method m = ((MethodSignature) pjp.getSignature()).getMethod()
May return a bridge method ( where further introspection would reveal no parameter annotations ) or the real method, where introspection on the method signature would reveal the parameter annotations
The only way I have found around this is via
BridgeMethodResolver.findBridgedMethod(key)
All though more by chance than via documentation
More discussion
http://forum.springsource.org/showthread.php?t=63403&page=1
Affects: 2.5.6
The text was updated successfully, but these errors were encountered: