-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Philipp Foermer opened SPR-17392 and commented
For "org.springframework.beans.factory.support.DefaultListableBeanFactory" the javadoc of
public java.lang.String[] getBeanNamesForAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)defines:
Find all names of beans whose Class has the supplied Annotation type, without creating any bean instances yet.
It would be nice, if the wording is precised, as a registered FactoryBean BeanDefinition is eagerly initialized, if the method is invoked.
I noticed this unexpected behaviour in a custom @Conditional Condition implementation, causing broken factory bean instances, because required preconditions have not been initialized before factory bean was eagerly initialized.
It seems that the eager initialization issue as been worked around in "org.springframework.boot.autoconfigure.condition.BeanTypeRegistry" by missing this case.
Affects: 4.3.17