Skip to content

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

Closed

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:

Activity

  1. added
    type: bug
    in: core
    on Jan 10, 2019
  2. added this to the 1.2.7 milestone on Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coretype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions