Skip to content

AOP PointCuts: ProceedingJointPoint provides the synthetic(bridge) and not the real method [SPR-5317] #9990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 24, 2008 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

There are no explicit guarantees for getting or not getting a synthetic method. Hence this doesn't really qualify as a bug.

That said - I agree that we should consider exposing the real method right away there...

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 M2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants