Optional autowire of Map<String, BeanType> accidentally falls back to unrelated Map<String, String> [SPR-13963] #18536
Closed
Description
Phil Webb opened SPR-13963 and commented
Upgrading Spring Boot to Framework to 4.3is not currently possible due to failure in EndpointAutoConfigurationTests
.
It appears that this line in EndpointAutoConfiguration
:
@Autowired(required = false)
private Map<String, HealthIndicator> healthIndicators = new HashMap<String, HealthIndicator>();
No longer works correctly as String values end up in the map.
I believe that commit 3f74a74481d is ultimately responsible as rolling this back seems to fix the issue.
Affects: 4.3 RC1
Issue Links:
- Allow for normal bean wiring semantics for types assignable to Map [SPR-7915] #12570 Allow for normal bean wiring semantics for types assignable to Map
- Self reference fallback in 4.3 is not meant to apply to collection elements [SPR-14965] #19532 Self reference fallback in 4.3 is not meant to apply to collection elements
- Can't autowire BiMap: container resolves non-matching Map of value beans [SPR-15117] #19684 Can't autowire BiMap: container resolves non-matching Map of value beans