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-issuemaster opened this issue Dec 30, 2016 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Dec 30, 2016

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-projects/spring-framework-issues#146

Referenced from: commits e8a082f, 8fc65ab

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 30, 2016

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 30, 2016

Juergen Hoeller commented

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.