FasterXML / jackson-dataformats-binary

Uber-project for standard Jackson binary format backends: avro, cbor, ion, protobuf, smile
Apache License 2.0
310 stars 133 forks source link

Fix ion null deserialization #296

Closed MartinGian closed 3 years ago

MartinGian commented 3 years ago

Fixes the IonValueDeserializer to be able to deserialize serialized null values correctly. Ion does have first class null values so a deserialized null value should never end up being a Java null value.

There is more information about this change in https://github.com/FasterXML/jackson-dataformats-binary/issues/295

mcliedtke commented 3 years ago

Changes LGTM. @cowtowncoder, do you mind merging? I think 2.13 would likely make the most sense.

cowtowncoder commented 3 years ago

Will merge (I have some concerns as to whether this will work reliably due to reliance on underlying JsonParser -- but there are tests and so perhaps it does -- and I don't have better ideas for solving it either). Unless the null value could be derived from type declaration?

But before merging, I'd suggest one addition that I mentioned, to avoid possibility of "wrong" null value getting cached. (I forget if caching is done or not, but if it was leaving out access mode could lead to pretty weird failures).