@@ -153,15 +153,16 @@ Letting qualifier values select against target bean names, within the type-match
153
153
candidates, does not require a `@Qualifier` annotation at the injection point.
154
154
If there is no other resolution indicator (such as a qualifier or a primary marker),
155
155
for a non-unique dependency situation, Spring matches the injection point name
156
- (that is, the field name or parameter name) against the target bean names and chooses the
157
- same-named candidate, if any.
156
+ (that is, the field name or parameter name) against the target bean names and chooses
157
+ the same-named candidate, if any (either by bean name or by associated alias).
158
+
159
+ This requires the `-parameters` Java compiler flag to be present. As a fallback,
160
+ version 6.0 still supports parameter names from debug symbols via `-debug` as well.
158
161
====
159
162
160
- That said, if you intend to express annotation-driven injection by name, do not
161
- primarily use `@Autowired`, even if it is capable of selecting by bean name among
162
- type-matching candidates. Instead, use the JSR-250 `@Resource` annotation, which is
163
- semantically defined to identify a specific target component by its unique name, with
164
- the declared type being irrelevant for the matching process. `@Autowired` has rather
163
+ As an alternative for injection by name, consider the JSR-250 `@Resource` annotation
164
+ which is semantically defined to identify a specific target component by its unique name,
165
+ with the declared type being irrelevant for the matching process. `@Autowired` has rather
165
166
different semantics: After selecting candidate beans by type, the specified `String`
166
167
qualifier value is considered within those type-selected candidates only (for example,
167
168
matching an `account` qualifier against beans marked with the same qualifier label).
0 commit comments