Odd behaviour with null bean instance when an alternative autowire candidate is available [SPR-16960] #21498
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: waiting-for-triage
An issue we've not yet triaged or decided on
Dave Syer opened SPR-16960 and commented
Since Spring 5.0 a
@Bean
can returnnull
and the effect is to leave the bean definition in the registry, but make the value not autowirable. However, if there is another bean of the same type that is not null, it does not become autowirable. Probably it should? The exception from Spring doesn't mention the existence of either bean (the null or the not null one):Affects: 5.0.7
Reference URL: spring-projects/spring-boot#13531
Issue Links:
The text was updated successfully, but these errors were encountered: