Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: autowire-candidate="false" does not affect autowire="byName" [SPR-15072] #19638

Closed
spring-projects-issues opened this issue Dec 30, 2016 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Senthil Kumar opened SPR-15072 and commented

According to this section of Spring Framework Reference documentation, when autowire-candidate is set to false in a bean's XML definition, it excludes the bean from the autowiring infrastructure. The section doesn't talk about any exceptions to this case.

This works when, on the depending bean, autowire is set to byType. But when it is set to byName, the autowire-candidate="false" configuration of the target bean is ignored and it is still autowired.


Affects: 4.3.5

Reference URL: spring-attic/spring-framework-issues#146

Referenced from: commits e8a082f, 8fc65ab

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This is an old design decision where autowire-candidate="false" only affects type-based autowiring attempts, not direct references by name... and not autowire="byName" either. While the latter may be debatable, I'm not inclined to change it at this point since autowire="byName" is an outdated mechanism to begin with. I'm therefore turning this into a documentation issue.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This is already mentioned in the spring-beans.xsd documentation. I've clarified it in the reference documentation as well now.

@spring-projects-issues spring-projects-issues added in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3.6 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants