Description
Alex opened SPR-2294 and commented
I have a class 'MyBean' with a property 'myMap' of type java.util.Map. Spring allows me to configure an instance of this class as follows, using mapped properties:
<bean id="myBean" class="com.foo.MyBean">
<property name="myMap[foo]" value="a" />
</bean>
This works fine.
However, I have an application where the map keys need to be mapped property names, e.g "foo.bar[0]". i.e. the map entry key itself contains the "[" and "]" character:
<bean id="myBean" class="com.foo.MyBean">
<property name="myMap[foo.bar[0]]" value="a" />
</bean>
When I call toString() on the myMap property after Spring has instantiated the bean, this is the result:
{foo.bar[0=a}
As you can see, the key for this map entry is missing the closing "]" character.
There appears to be a bug in the string parsing of the mapped property name?
Affects: 1.2.8
Issue Links:
- Handle nested brackets in a map keys [SPR-1274] #5976 Handle nested brackets in a map keys ("duplicates")
1 votes, 1 watchers