Skip to content

Cannot intercept calls to protected methods of CGLIB proxied class [SPR-1611] #6308

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions