Commit 7ae75c27 authored by Phillip Webb's avatar Phillip Webb

Merge branch '1.1.x'

parents 43e0cae0 fcad7c4f
......@@ -106,26 +106,24 @@ public class OnBeanCondition extends SpringBootCondition implements
"Unable to use SearchStrategy.PARENTS");
beanFactory = (ConfigurableListableBeanFactory) parent;
}
if (beanFactory == null) {
return Collections.emptyList();
}
List<String> beanNames = new ArrayList<String>();
boolean considerHierarchy = beans.getStrategy() == SearchStrategy.ALL;
for (String type : beans.getTypes()) {
beanNames.addAll(getBeanNamesForType(beanFactory, type,
context.getClassLoader(), considerHierarchy));
}
for (String annotation : beans.getAnnotations()) {
beanNames.addAll(Arrays.asList(getBeanNamesForAnnotation(beanFactory,
annotation, context.getClassLoader(), considerHierarchy)));
}
for (String beanName : beans.getNames()) {
if (containsBean(beanFactory, beanName, considerHierarchy)) {
beanNames.add(beanName);
}
}
return beanNames;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment