alibaba / spring-context-support

An internal support project for spring-context in Alibaba
Apache License 2.0
150 stars 83 forks source link

[Issue] The method com.alibaba.spring.util.BeanFactoryUtils#getBeans causes the Spring Beans being initialized eagerly #20

Closed mercyblitz closed 4 years ago

mercyblitz commented 4 years ago

To fix this line in the method of com.alibaba.spring.util.BeanFactoryUtils#getBeans:

String[] allBeanNames = beanNamesForTypeIncludingAncestors(beanFactory, beanType);

TO BE:

String[] allBeanNames = beanNamesForTypeIncludingAncestors(beanFactory, beanType, true, false);