After the changes for #21218, AopUtils.getMostSpecificMethod does not resolve proxy class methods anymore. It turns out that this is a regression for some scenarios, in particular for dynamic proxies as targets with their redeclaration of all interface methods at the most specific level. In order for Method.getDeclaringClass() to expose the concrete type again in such scenarios, we should rather revisit that algorithm to not specifically handle proxy class methods, just consistently skipping resolution for CGLIB cases (in particular configuration classes and lookup-method classes) as we did in a few places before already.
Affects: 5.0.5
Issue Links:
#21264 AspectJ execution pointcut does not detect methods in superinterface anymore
#21216 Comprehensively cache annotated methods for interfaces and superclasses
#21218 Mixed use BeanNameAutoProxyCreator and AnnotationAwareAspectJAutoProxyCreator to proxy same bean
#21343 AspectJ annotation pointcuts fail to evaluate against interface-based proxies
#21541 Spring 5.x DataSource proxying does not work with Oracle UCP on JDK 9+
#21319 Consistent target method resolution for event and caching expressions
The text was updated successfully, but these errors were encountered:
Juergen Hoeller opened SPR-16757 and commented
After the changes for #21218,
AopUtils.getMostSpecificMethod
does not resolve proxy class methods anymore. It turns out that this is a regression for some scenarios, in particular for dynamic proxies as targets with their redeclaration of all interface methods at the most specific level. In order forMethod.getDeclaringClass()
to expose the concrete type again in such scenarios, we should rather revisit that algorithm to not specifically handle proxy class methods, just consistently skipping resolution for CGLIB cases (in particular configuration classes and lookup-method classes) as we did in a few places before already.Affects: 5.0.5
Issue Links:
The text was updated successfully, but these errors were encountered: