Skip to content

DataBinder throws StringIndexOutOfBoundsException for map property without nested property path #34043

@n0rthdev

Description

@n0rthdev

Since upgrading to Spring 6.2. we have the Issue that maps in form-data requests are no longer working.
After switching the DTO to using String keys, we are now getting an IndexOutOfRange in DataVinder.createMap
e48cbc5#diff-1f22c41307a3ddcec8f1bc7a237d3b77ac7564883f4c663402993affac8a5756R1071

the issue seems to be the +2 in String nestedPath = name.substring(0, endIdx + 2); this works if the name is something like: mapname[91].myparam but not if the map is just key and value then having name mapname[91]

The tests for this method do not cover my case so I am wondering if this my usecase might no longer be supported?

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions