Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track when isLazyInit has been set in AbstractBeanDefinition #22694

Closed
philwebb opened this issue Mar 27, 2019 · 0 comments
Closed

Track when isLazyInit has been set in AbstractBeanDefinition #22694

philwebb opened this issue Mar 27, 2019 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

As discussed in spring-projects/spring-boot#16184 (comment) it would be useful if @Lazy(false) could be used as signal that lazy initialization has been specifically disabled. This is not currently possible due to the fact that the AbstractBeanDefinition.isLazyInit() method uses a primitive boolean so there is no difference between @Lazy(false) and a missing annotation.

One suggestion made is to offer a getLazyInit method that returns Boolean.TRUE, Boolean.FALSE or null. Alternatively, we could also consider a LazyMode enum that provides ENABLED, DISABLED or DEFAULT as values.

@jhoeller jhoeller self-assigned this Mar 27, 2019
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 27, 2019
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 27, 2019
@jhoeller jhoeller added this to the 5.2 M1 milestone Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants