Track when isLazyInit has been set in AbstractBeanDefinition #22694
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
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 theAbstractBeanDefinition.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 returnsBoolean.TRUE
,Boolean.FALSE
ornull
. Alternatively, we could also consider aLazyMode
enum that providesENABLED
,DISABLED
orDEFAULT
as values.The text was updated successfully, but these errors were encountered: