-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
NPE with CollectionDeserializer
with TreeSet
class, with input null
#1393
Comments
I don't like the idea of magic null suppression, especially as this would only be relevant for tree-based One thing that may help is work I am planning for 2.9 that does allow annotation-based (and type-defaults too) configurable handling of incoming |
My simple suggestion is to create a parameter in DeserializationFeature class, to allow the supression of the null value in the collections in this way is a developer to define what best suits your situation. |
Actually while I do not like one-off feature for null handling for just collections, I think it would be valid to block |
CollectionDeserializer
with TreeSet
class, with input null
For what it's worth, #1402 will add a way to address this in general fashion. Leaving this open for now until it gets implemented. |
Actually closing as it should be handled via #1402, and I have no plans for type-specific hack. |
Hello,
I've a problem while trying deserialize a TreeSet with a custom deserializer, in my situation deserializer not find the registry to add the collection, and returns null, but as TreeSet does not accept nulls, pops exception in Java, as below:
The suggestion is to treat null for this situation in the Collection Deserializer, and not add the item in the list in return. Line 284 of CollectionDeserializer class.
https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java
I've searched for an issue linked to that, without success in the issue tracker.
Thanks for your help.
The text was updated successfully, but these errors were encountered: