Skip to content

Field name is used to match on bean name when @Autowired matches several beans by type [SPR-16142] #20690

@spring-projects-issues

Description

@spring-projects-issues

Rasmus Lund opened SPR-16142 and commented

As shown by the referenced example project, field name is used to match on bean name when @Autowired matches several beans by type. We can't find this behavior documented anywhere. Is it by accident or by purpose? If by purpose, it should be mentioned in the reference documentation when @Autowired is described.

Note: The example project referenced by the URL shows a minimal setup that illustrates the unexpected behavior. It also has a more verbose explanation in its README.md.


Reference URL: https://github.com/mkjensen/spring-question

Issue Links:

Backported to: 4.3.13

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions