Skip to content

Support for null bean in functional bean registration [SPR-17057] #21595

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits 28f7b26

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions