Skip to content

support non-lenient constructor injection [SPR-5816] #10486

@spring-projects-issues

Description

@spring-projects-issues

Costin Leau opened SPR-5816 and commented

Currently, for constructor injection the container assumes a default type of String for values injected. Consider the following class:

Foo(String s) {}
Foo(Boolean b) {}
<bean class="Foo">
<constructor-arg value="true"/>
</bean>

Currently Spring will pick the first (String) constructor - arguably the second one is also valid. It would be useful to have a flag or some means (even programatically) to change this behaviour so when more then one constructor are found suitable, an exception is raised.


Affects: 3.0 M3

Issue Links:

Referenced from: commits 8e27971, a9254b3

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions