Skip to content

BeanDeserializerModifier.updateBuilder() not work to set custom deserializer on a property (since 2.9.0) #1912

@deblockt

Description

@deblockt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions