-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
(note: offshoot of #992)
By default, Jackson will try to call setAccessible(true)
on all methods and fields it has to access via Reflection. This is necessary for cases where member are non-public, but it has also been beneficial for other cases since doing so will suppress some access checks JVM would otherwise perform; this was benchmarked to have significant effect on JDK 1.5 at least.
It is possible to suppress all calls to setAccessible
by disabling MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS
. This is needed on platforms where SecurityManager
prevents all access.
However, it seems useful to also allow more granular change, to avoid calls for public
members, and only try to make it for non-public cases where access would otherwise fail.
To do this, let's add new MapperFeature
, OVERRIDE_PUBLIC_ACCESS_MODIFIERS
in 2.7.