You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use ObjectMapper.disable(MapperFeature.AUTO_DETECT_XXX) to disable autodetection of all kind of property accessors. After updating to jackson 2.9 I noticed that this method doesn't work anymore and visibility is reset to default (ANY for getters/is getters and public for other)
Yes, I can reproduce this. Looks like optimization in code (trying to avoid calculations if "no change to defaults") has wrong logic.
cowtowncoder
changed the title
MapperFeature.AUTO_DETECT_XXX do not work if applied all at once.MapperFeature.AUTO_DETECT_XXX do not work if all disabled
Mar 6, 2018
We use ObjectMapper.disable(MapperFeature.AUTO_DETECT_XXX) to disable autodetection of all kind of property accessors. After updating to jackson 2.9 I noticed that this method doesn't work anymore and visibility is reset to default (ANY for getters/is getters and public for other)
I've created a repository that shows this issue:
https://github.com/saladinkzn/jackson-auto-detect-issue
If run without changes it produces following output:
But if I comment out any disable line (e.g. AUTO_DETECT_IS_GETTER) I receive following output:
I guess the reason is that getDefaultVisibilityChecker explicitly skips disabling if none of AUTO_DETECT features is enabled.
https://github.com/FasterXML/jackson-databind/blob/jackson-databind-2.9.4/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfigBase.java#L675
P.S.
I see that this code is rewritten in master branch already, so I'll try to reproduce my issue on it.
The text was updated successfully, but these errors were encountered: