Skip to content

Commit daad992

Browse files
committed
Merge branch '1.5.x' into 2.0.x
2 parents 136be59 + f1cf41f commit daad992

File tree

1 file changed

+11
-6
lines changed
  • spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition

1 file changed

+11
-6
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ else if (!this.beanFactory.isAlias(name)) {
155155
}
156156

157157
private void addBeanTypeForNonAliasDefinition(String name) {
158-
addBeanTypeForNonAliasDefinition(name, getBeanDefinition(name));
158+
RootBeanDefinition beanDefinition = getBeanDefinition(name);
159+
if (beanDefinition != null) {
160+
addBeanTypeForNonAliasDefinition(name, beanDefinition);
161+
}
159162
}
160163

161164
private RootBeanDefinition getBeanDefinition(String name) {
@@ -215,11 +218,13 @@ private void updateTypesIfNecessary() {
215218
if (!this.beanFactory.isAlias(name)
216219
&& !this.beanFactory.containsSingleton(name)) {
217220
RootBeanDefinition beanDefinition = getBeanDefinition(name);
218-
RootBeanDefinition existingDefinition = this.beanDefinitions.put(name,
219-
beanDefinition);
220-
if (existingDefinition != null
221-
&& !beanDefinition.equals(existingDefinition)) {
222-
addBeanTypeForNonAliasDefinition(name, beanDefinition);
221+
if (beanDefinition != null) {
222+
RootBeanDefinition existingDefinition = this.beanDefinitions
223+
.put(name, beanDefinition);
224+
if (existingDefinition != null
225+
&& !beanDefinition.equals(existingDefinition)) {
226+
addBeanTypeForNonAliasDefinition(name, beanDefinition);
227+
}
223228
}
224229
}
225230
}

0 commit comments

Comments
 (0)