When DataBinder resolves a Map<String, T> constructor parameter during constructor binding, createMap() iterates all parameter names and calls createIndexedValue() — and therefore createObject() for non-simple value types — once per matching parameter name rather than once per distinct map key. For a map entry whose value type has multiple constructor parameters, each sub-field parameter name triggers a full nested object construction for the same key, with all but the last result immediately discarded.
To address this, we can probably skip createIndexedValue() when the extracted key is already present in the map, aligning createMap() with createList() and createArray(), which already avoid redundant element construction by deduplicating indexes via getIndexes() before iterating.
NOTE: This issue is assigned and therefore not suitable for community contributions.
When
DataBinderresolves aMap<String, T>constructor parameter during constructor binding,createMap()iterates all parameter names and callscreateIndexedValue()— and thereforecreateObject()for non-simple value types — once per matching parameter name rather than once per distinct map key. For a map entry whose value type has multiple constructor parameters, each sub-field parameter name triggers a full nested object construction for the same key, with all but the last result immediately discarded.To address this, we can probably skip
createIndexedValue()when the extracted key is already present in the map, aligningcreateMap()withcreateList()andcreateArray(), which already avoid redundant element construction by deduplicating indexes viagetIndexes()before iterating.NOTE: This issue is assigned and therefore not suitable for community contributions.