Closed
Description
Dave Syer opened SPR-17057 and commented
You can return null
from a @Bean
method and it does some clever stuff internally using a final package private class (which is therefore inaccessible to users) called NullBean
. The result is just a bean that cannot satisfy any dependencies. It would make sense if the functional form of the same bean could do the same trick, either returning null
from the Supplier
or some other contract that allows the BeanFactory
to behave the same way.
Affects: 5.0.7
Issue Links:
- Consistent non-exposure of null beans in the BeanFactory API [SPR-17034] #21572 Consistent non-exposure of null beans in the BeanFactory API
- Use available type information in functional bean definitions for resolving FactoryBean type [SPR-17063] #21601 Use available type information in functional bean definitions for resolving FactoryBean type
Referenced from: commits 28f7b26