-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Mindaugas Malinauskas opened SPR-1611 and commented
When I try to proxy a class using CGLIB, protected methods don't get proxied, i.e. protected method invocations are not intercepted.
As I found out this restriction is caused by this code fragment in class org.springframework.aop.framework.Cglib2AopProxy$ProxyCallbackFilter:
// don't modify protected methods
if(Modifier.isProtected(method.getModifiers())) {
return NO_OVERRIDE;
}
As I detected this restriction was added to solve problem #5087 (http://opensource2.atlassian.com/projects/spring/browse/SPR-357) witch was caused by CGLIB library. Currently used version of CGLIB library is fixed, so the fragment above doesn't fix anything but just restricts. Removing the fragment of code wouldn't make any unit test to fail.
Further discutions may be found at http://forum.springframework.org/showthread.php?t=21299
Affects: 1.2.5
Issue Links:
- Clarification: Spring AOP pointcuts match protected methods when CGLIB is used [SPR-15354] #19917 Clarification: Spring AOP pointcuts match protected methods when CGLIB is used