BeanNotOfRequiredTypeException (NullBean instead of null) when calling ApplicationContext.getBean(name, type) [SPR-16342] #20889
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
Stefan Mueller opened SPR-16342 and commented
#20582 and #20711 fixed a similar bug. The problem still exists if calling ctx.getBean(name, type) for a null-bean which in older Spring versions (pre 5) returned null and now throws a org.springframework.beans.factory.BeanNotOfRequiredTypeException.
Can be reproduced by adding the following to spring-framework-issues
Affects: 5.0.2
Issue Links:
@Bean
return nullThe text was updated successfully, but these errors were encountered: