Dave Syer opened SPR-5379 and commented

@Autowired with @Qualifier should be able to inject a bean with autowire-candidate="false". The @Autowired annotation in this case is being used more in the sense of "@Wired" (not really "auto" anything, since i have specified the precise bean definition I want with a qualifier). The bean I want to inject has to be autowire-candidate="false" to prevent it from being injected anywhere else.


Affects: 2.5.6

Referenced from: commits https://github.com/spring-projects/spring-framework/commit/7aec01bbac39a9f010160f83aadef9656fb97985

Comment From: spring-projects-issues

Juergen Hoeller commented

This is actually intended: autowire-candidate="false" is a strict exclusion from any kind of autowiring. I don't find it natural to switch that to false and then still expect that bean to be a candidate for @Autowired processing? In any case, we need to document this properly.

Juergen

Comment From: spring-projects-issues

Costin Leau commented

added clarifications to section 3.4.5.2 "Excluding a bean from autowiring"

Comment From: JerryChin

What's the point of autowireCandidate then?