You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for null bean in functional bean registration [SPR-17057] #21595
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.
Indeed, in particular with 5.1's refined null bean semantics, a null-returning instance supplier should simply resolve to NullBean as well (instead of rejecting the null return value there).
Activity
spring-projects-issues commentedon Jul 18, 2018
Juergen Hoeller commented
Indeed, in particular with 5.1's refined null bean semantics, a null-returning instance supplier should simply resolve to
NullBeanas well (instead of rejecting the null return value there).