Skip to content
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() not work to set custom deserializer on a property (since 2.9.0) #1912

Closed
deblockt opened this issue Jan 29, 2018 · 0 comments
Milestone

Comments

@deblockt
Copy link
Contributor

Since 2.9 use BeanDeserializerModifier.updateBuilder not work to set custom deserializer on a property.

This is because this method on BeanDeserializerBase has bean replace by this :

old

public SettableBeanProperty findProperty(String propertyName)
{
    SettableBeanProperty prop = (_beanProperties == null) ?
            null : _beanProperties.find(propertyName);
    if (prop == null && _propertyBasedCreator != null) {
        prop = _propertyBasedCreator.findCreatorProperty(propertyName);
    }
    return prop;
}

new

    public SettableBeanProperty findProperty(String propertyName)
    {
        SettableBeanProperty prop = (_beanProperties == null) ?
                null : _beanProperties.find(propertyName);
        if (_neitherNull(prop, _propertyBasedCreator)) {
            prop = _propertyBasedCreator.findCreatorProperty(propertyName);
        }
        return prop;
    }

   protected final static boolean _neitherNull(Object a, Object b) {
        return (a != null) && (b != null);
    }

prop == null has been replace by prop != null.

So custom deserializer can not be used and are replaced by default.

@deblockt deblockt changed the title updateBuilder addOrReplaceProperty unused since 2.9 updateBuilder addOrReplaceProperty unusable since 2.9 Jan 29, 2018
@cowtowncoder cowtowncoder modified the milestones: 2.9,0.pr4, 2.9.5 Feb 5, 2018
@cowtowncoder cowtowncoder changed the title updateBuilder addOrReplaceProperty unusable since 2.9 BeanDeserializerModifier.updateBuilder() not work to set custom deserializer on a property (since 2.9.0) Feb 5, 2018
cowtowncoder added a commit that referenced this issue Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants