You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Optional autowire of Map<String, BeanType> accidentally falls back to unrelated Map<String, String> [SPR-13963] #18536
We're explicitly excluding Collection and Map beans from fallback matching now. They are being treated specifically for autowiring purposes in general, so it's not out of the ordinary to handle them specifically here as well.
However, this also means that Collection and Map beans never match unless they qualify as a full generic type match. This is easy enough to accomplish with factory methods with a specifically declared return type... but hard with a regular XML bean definition. I'm not too concerned though since this feature is not primarily about plain value holder collections; it's rather about implementations beans which happen to implement Collection / Map as well. Arbitrary Collection and Map beans can still be injected using @Resource, as before.
Activity
spring-projects-issues commentedon Feb 18, 2016
Juergen Hoeller commented
We're explicitly excluding Collection and Map beans from fallback matching now. They are being treated specifically for autowiring purposes in general, so it's not out of the ordinary to handle them specifically here as well.
However, this also means that Collection and Map beans never match unless they qualify as a full generic type match. This is easy enough to accomplish with factory methods with a specifically declared return type... but hard with a regular XML bean definition. I'm not too concerned though since this feature is not primarily about plain value holder collections; it's rather about implementations beans which happen to implement
Collection/Mapas well. Arbitrary Collection and Map beans can still be injected using@Resource, as before.Juergen