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
base: 2.17
Are you sure you want to change the base?
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.
Merged test from here to under |
The promised UTs and possible fix for #4356