-
-
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
ArrayNode.addAll()
adds raw null
values which cause NPE on deepCopy()
and toString()
#2442
Comments
First of all: thank you for reporting the issue! Yes, that looks like a problem, although surprisingly one that has not been reported before. I agree that raw It seems reasonable to expect former, so that I'll think about this bit more, and will get fixed for |
Hi @cowtowncoder, thanks for the quick reply. I also agree with you about the former being the more suitable solution to be consistent with the rest of the methods. I attempted to provide a fix for it here: #2443 |
ArrayNode.addAll()
adds raw null
values which cause NPE on deepCopy()
and toString()
any expected date when 2.10.0 will be released? |
@heshamMassoud Hoping to release before end of September, ideally within 2 weeks. |
Version:
2.9.9
When I create an
ArrayNode
and useArrayNode#addAll
to add elements containing a rawnull
element as follows:Calling
ArrayNode#deepCopy
andArrayNode#toString
on sucharrayNode
will throwNullPointerException
s.However, if we add the nodes using
ArrayNode#add
as follows:Calling
ArrayNode#deepCopy
andArrayNode#toString
on sucharrayNode
will NOT throw anyNullPointerException
s.This is because
ArrayNode#add
converts any rawnull
to aNullNode
object:jackson-databind/src/main/java/com/fasterxml/jackson/databind/node/ArrayNode.java
Lines 306 to 313 in f75b304
But
ArrayNode#addAll
does not. But It should, otherwise how does one deepCopy an arrayNode that containsnull
raw elements?The text was updated successfully, but these errors were encountered: