Correctly parse property name in path "map[key[foo]]" #21855
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a
Bean
that contains aMap
. In thisMap
we want to save properties with property names which contain an index that is relevant for our application only, likekey5[foo]
. For spring that index doesn't matter, it should just treatkey5[foo]
as property name.However spring-bean is not able to correctly retrieve the property name, it tries to retrieve
key5[foo
(missing square bracket at the end). That's because spring just looks for the first occurrence of]
and thinks it's the closing square bracket of the property name, however in our case that square bracket is part of the property name, and the relevant square bracket for spring (to actually close the property name) comes afterwards.Would be nice if this could be backported to
5.1.x
.Thanks!