Skip to content

Make JsonMapper/ObjectMapper fully proxyable by CGLIB #5442

@Eng-Fouad

Description

@Eng-Fouad

Search before asking

  • I searched in the issues and found nothing similar.

Describe the bug

After upgrading to Spring Boot 4.0.0, we noticed this warning:

o.s.aop.framework.CglibAopProxy          : Public final method [public final java.lang.Object tools.jackson.databind.ObjectMapper.readValue(tools.jackson.core.JsonParser,tools.jackson.core.type.ResolvedType) throws tools.jackson.core.JacksonException] cannot get proxied via CGLIB, consider removing the final marker or using interface-based JDK proxies.

It is a new change since Spring Framework 7 that prints warning when trying to proxy a class with public final methods.

I see only one method in JsonMapper/ObjectMapper that is public final:

@SuppressWarnings("unchecked")
public final <T> T readValue(JsonParser p, ResolvedType valueType) throws JacksonException
{
_assertNotNull("p", p);
return (T) _readValue(_deserializationContext(p), p, (JavaType) valueType);
}

So, this is an enhancement request to remove final from that public method.

Version Information

3.0.2

Reproduction

No response

Expected behavior

No response

Additional context

spring-projects/spring-boot#48214

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions