Skip to content

BeanWrapperImpl doesn't delegate Map-creation to propertyEdtior [SPR-3565] #8248

@spring-projects-issues

Description

@spring-projects-issues

Robert Scholte opened SPR-3565 and commented

With the use of a wizardform I'm trying to to fill a command, in this case I want to fill a Map with a Collection of Dates. This means that the BeanWrapperImpl.class is responsible of building the command with use of the configured PropertyEditors

In the method private Object getPropertyValue(PropertyTokenHolder tokens) the readMethod for the Map is called. The result is null, since the propertyEditor is responsible for creating the Map if required / configured.

Althougt the Map is null, there's a check if token.keys != null, which is true, so the code tries to apply indexes and map keys. As expected this is not possible, so a NullValueInNestedPathException is thrown.

IMHO event though the Map is null, you should try to convert value with the registered PrpertyEdtior (by default null is converted to null, so no problem here I guess).


Affects: 2.0.5

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions