Closed jc84-dev closed 3 years ago
Hmmh. I can see why this is sub-optimal. I think the root cause may be due to Optional
itself being immutable (you cannot change value one has, only create new instance), which may be why merge is not attempted.
Quick question: just for reproduction, would behavior be identical if you used AtomicReference
? I ask because they both use same base deserializer, ReferenceTypeDeserializer
, and should for the most part exhibit same behavior.
If so, I could add reproduction using AtomicReference
in jackson-databind
and same fix would likely apply.
If that did not fail the problem is more likely in this package.
AtomicReference works well. looks like it is specific to Optional
Was about to claim I cannot reproduce this, until I realized I had not initialized Optional
field to Optional.empty()
. Once I add that, I see the exception.
Note that @JsonMerge
is absolutely needed there (or global configuration to default to merge): otherwise that property won't be merged no matter what.
I think I can fix this for 2.12.4.
As per notes, now fixed in 2.12 branch, to be included in 2.12.4.
thanks
assume we have