Support for null bean in functional bean registration [SPR-17057] #21595
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Uh oh!
There was an error while loading. Please reload this page.
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) calledNullBean
. 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 returningnull
from theSupplier
or some other contract that allows theBeanFactory
to behave the same way.Affects: 5.0.7
Issue Links:
Referenced from: commits 28f7b26
The text was updated successfully, but these errors were encountered: