Skip to content

fix NPE for unknown fields #2297

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

Merged
merged 1 commit into from
Apr 12, 2019
Merged

fix NPE for unknown fields #2297

merged 1 commit into from
Apr 12, 2019

Conversation

PolinaRodimova
Copy link

No description provided.

ObjectMapper mapper = JsonMapper.builder().addHandler(new DeserializationProblemHandler(){
@Override
public boolean handleUnknownProperty(DeserializationContext ctxt, JsonParser p, JsonDeserializer<?> deserializer, Object beanOrClass, String propertyName) throws IOException {
p.readValueAsTree();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPE is here without changes in BeanDeserializerBase

@cowtowncoder
Copy link
Member

Thank you very much for reporting this and submitting the fix (plus tests which is the best part)!

Only one process thing before I can merge this in: if we haven't yet asked, we need CLA before the first contribution, from:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

and usually the easiest way is to print, fill & sign, scan, email to info at fasterxml dot com.
It's a one-time thing and valid for all Jackson projects.
If you could get this done, I'll merge this ASAP.

Thank you once again for the contribution.

@PolinaRodimova
Copy link
Author

PolinaRodimova commented Apr 9, 2019 via email

@PolinaRodimova
Copy link
Author

Read your message one more time and sent it to [email protected] :)

@cowtowncoder
Copy link
Member

Excellent! Github unfortunately doesn't do attachment very well. It would be nice to have more automated way to deal with CLAs but so far this has been sufficient to keep IP lawyers off our back so that's good. :)

@cowtowncoder cowtowncoder merged commit e4e3b73 into FasterXML:master Apr 12, 2019
@cowtowncoder cowtowncoder added this to the 3.0.0 milestone Apr 12, 2019
@cowtowncoder
Copy link
Member

Thank you again -- this exposed a few other similar places, where ObjectReadContext should be passed. And also no-args asParser() should create ObjectReadContext.empty(); I also deprecated that since caller should do that explicitly if there is no context to pass (and not because caller was not aware that context is expected).

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

Successfully merging this pull request may close these issues.

2 participants