-
-
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
BeanDeserializerModifier::updateBuilder shall work for immutable beans too (#4356) #4357
Conversation
Ahh. Ok, also realized what "immutable" specifically means: properties being passed via Creator method. Makes sense, but somehow was thinking of something Lombok- or builder-style ones. |
@@ -551,6 +551,14 @@ public void resolve(DeserializationContext ctxt) throws JsonMappingException | |||
} | |||
SettableBeanProperty newProp = prop.withValueDeserializer(deser); | |||
_replaceProperty(_beanProperties, creatorProps, prop, newProp); | |||
} else if (creatorProps != null) { | |||
for (int i = 0, len = creatorProps.length; i < len; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels wrong, as in it should not be necessary. But I'll need to spend some time figuring out why creator property in question was not updated.
Looking bit further ahead, commented out code-section at line 687 might be what is needed, and/or indicates there is a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that won't help as apparently property has value deserializer but somehow creatorProps
has not been properly updated earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I guess creatorProps
returned by [Std]ValueInstantiator
has not been synced with changes made via updateBuilder()
. So that is legit problem to resolve, just not sure where it should be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that #4515 is completed, can rule out problem with linkage. I do think that BeanDeserializerBuilder
needs access to the property-based creator, and that the issue here really is that CreatorProperty
within that Creator does not properly updated when property in _properties
is updated.
So the question is then how to pass it along, update properly.
Merged test from here to under |
Fixed via #4556 for inclusion in 2.18.0. |
The promised UTs and possible fix for #4356