Skip to content

Incorrect string parsing of mapped property names [SPR-2294] #6983

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

1 votes, 1 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions