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

Improve handling of null insertion failure for TreeSet #4262

Closed
cowtowncoder opened this issue Dec 14, 2023 · 1 comment
Closed

Improve handling of null insertion failure for TreeSet #4262

cowtowncoder opened this issue Dec 14, 2023 · 1 comment
Labels
2.17 Issues planned at earliest for 2.17
Milestone

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Dec 14, 2023

Describe your Issue

(note: tackling issue surfaced by OSS-Fuzz via https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64509)

Currently attempts to deserialize null values for TreeSet will fail with underlying NPE which usually gets wrapped as JsonMappingException (unless DeserializationFeature.WRAP_EXCEPTIONS is disabled). While acceptable this is not optimal failure indication: let's instead catch NPE and throw more meaningful exception; similar to Guava change:

FasterXML/jackson-datatypes-collections#132

@cowtowncoder cowtowncoder added to-evaluate Issue that has been received but not yet evaluated 2.17 Issues planned at earliest for 2.17 and removed to-evaluate Issue that has been received but not yet evaluated labels Dec 14, 2023
@cowtowncoder
Copy link
Member Author

cowtowncoder commented Dec 14, 2023

Note: change needed for CollectionDeserializer (and should only catch and handle NPE for TreeSet); we don't want to assume all NPEs are due to same root cause.

NOTE: earlier comment referred to TreeMap too -- but that might not have same issue (as there's no way to get null for JSON Object keys).

@cowtowncoder cowtowncoder changed the title Improve handling of null insertion failure for TreeSet / TreeMap Improve handling of null insertion failure for TreeSet Dec 15, 2023
@cowtowncoder cowtowncoder added this to the 2.17.0 milestone Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.17 Issues planned at earliest for 2.17
Projects
None yet
Development

No branches or pull requests

1 participant