Document that CGLIB cannot proxy package private methods declared in a superclass is in a different package #28973
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: documentation
A documentation task
Milestone
This is issue is somewhat hard to explain. I created a small project where this issue can be demonstrated.
Given following classes:
If we pass around instance of
DerivedClass
and on that instanceBaseClass.serialize
is called, thenreturn mapper.writeToString(value);
will throw null pointer exception.It seems that CGLIB is not proxying the
String serialize(Object value)
method. However, if we moveDerivedClass
into same package or eitherString serialize(Object value)
orprivate ObjectMapper getMapper()
is madeprotected
, then it works.NOTE: We noticed this when upgrading from spring-boot 2.1.18 to 2.2.13, but it is also reproducible on 2.7.2.
The text was updated successfully, but these errors were encountered: