JsonNode.binaryValue()
ignores illegal character if it's the last one
#1425
Milestone
JsonNode.binaryValue()
ignores illegal character if it's the last one
#1425
Some invalid base64 inputs do not throw an exception while others do.
Code to reproduce the problem (using Jackson version 2.8.4):
Output:
First case - everything OK
Second case - I would expect the same behavior as in the third case
Third case - intuitively it's not surprising that an exception is thrown here.
However there seems to be a mismatch between code behavior and JavaDoc of
binaryValue()
method which says thatJsonNode::binaryValue
returns "Binary data this node contains, iff it is a binary node; null otherwise". So based on the javadoc I would expect that in the second and third casebinaryValue()
returns null.The text was updated successfully, but these errors were encountered: