Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field detection regression between Jackson 2.8 and 2.9 #1972

Closed
hgschmie opened this issue Mar 15, 2018 · 10 comments
Closed

field detection regression between Jackson 2.8 and 2.9 #1972

hgschmie opened this issue Mar 15, 2018 · 10 comments

Comments

@hgschmie
Copy link

Using this test code: https://github.com/airlift/airlift/blob/master/json/src/test/java/io/airlift/json/TestJsonModule.java#L101-L110

which explicitly tests that in an object mapper that has all autodetection disabled: https://github.com/airlift/airlift/blob/master/json/src/main/java/io/airlift/json/ObjectMapperProvider.java#L107-L130

This test passes with Jackson 2.8. With Jackson 2.9, it reports

[ERROR] testFieldDetection(io.airlift.json.TestJsonModule) Time elapsed: 0.007 s <<< FAILURE!
java.lang.AssertionError: Sets differ: expected [make, model, year, purchased, nameList] but got [make, model, year, purchased, notes, nameList]
at io.airlift.json.TestJsonModule.testFieldDetection(TestJsonModule.java:109)

So the field, that is supposed to not-detected by Jackson is detected by 2.9 (but not by 2.8). I tested with 2.8.1 (passes), 2.8.11 (passes), 2.9.0 (fails) and 2.9.4 (fails).

Looking through the release notes I did not find anything that would explain this behavior (or how to turn it off), so I consider that an actual regression.

@cowtowncoder
Copy link
Member

Ok sounds legit. 2.9.5 does have one bug fix, #1947, and I wonder if that might be related or same.

@cowtowncoder
Copy link
Member

Looking at code, I am wondering if I am missing something, regarding base visibility settings.
If the intent is to disable introspection of fields, default settings need to be changed, as public fields are detected by default. So I was expecting to see something do that, but test seems to use quite basic ObjectMapper. Since a DI framework is being used it is quite possible I am just missing that wiring which could explain the difference.

As to changes: no planned changes were made to change the logic between 2.8 and 2.9.

@hgschmie
Copy link
Author

Will test as soon as 2.9.5 comes out. Are snapshots available from somewhere? (oss?)

@cowtowncoder
Copy link
Member

@hgschmie Sonatype snapshots should have auto-built 2.9.5-SNAPSHOT. Although there have been some issues with dependencies (jackson-base and/or jackson-parent did not get travis-built from commits), so may require some local building.

@hgschmie
Copy link
Author

I can confirm that 2.9.5-SNAPSHOT for core and databind (these are the deps that I have replaced) fix the problem. So this seems to be the problem described in #1947 .

@mbasmanova
Copy link

I ran into this issue as well. When will 2.9.5 release become available?

@cowtowncoder
Copy link
Member

cowtowncoder commented Mar 21, 2018

Planning to release 2.9.5 before end of the month, possibly over the weekend.

@hgschmie
Copy link
Author

Already wrote above that the fix in #1947 fixes the problem for me. So
shipit-animated

@cowtowncoder
Copy link
Member

@hgschmie ah sorry. Somehow missed your update, didn't see it. Thanks!

@cowtowncoder
Copy link
Member

Fixed by 2.9.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants