Skip to content

ACCEPT_CASE_INSENSITIVE_PROPERTIES is not respected for creator properties #1438

@apatrida

Description

@apatrida

reported in FasterXML/jackson-module-kotlin#47

When creators with properties are used, databind assumes that the name returned for hte property is literal (i.e. provided with JsonProperty annotation) but in cases where properties are provided implicitly (Java 8, or Kotlin Module) this is not the case, the target property name is provided.

So when the ACCEPT_CASE_INSENSITIVE_PROPERTIES feature is used anything that has a case mismatch fails.

in BeanDeserializer

// in BeanDeserializer...

SettableBeanProperty creatorProp = creator.findCreatorProperty(propName);
// null is returned
if (creatorProp != null) {
                  ...
}

which calls findCreatorProperty() in PropertBasedCreator:

public SettableBeanProperty findCreatorProperty(String name) {
        // fails because does not do case insensitive check when ACCEPT_CASE_INSENSITIVE_PROPERTIES is true
        return _propertyLookup.get(name);
    }

The hash lookup does not use the value of this feature switch like it does when looking for properties to be set after construction.

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