Merge pull request #13818 from Johnny Lim

* gh-13818:
  Add null guards for getBeanDefinition() in BeanTypeRegistry
pull/13985/head
Andy Wilkinson 6 years ago
commit f1cf41f544

@ -159,7 +159,10 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
}
private void addBeanTypeForNonAliasDefinition(String name) {
addBeanTypeForNonAliasDefinition(name, getBeanDefinition(name));
RootBeanDefinition beanDefinition = getBeanDefinition(name);
if (beanDefinition != null) {
addBeanTypeForNonAliasDefinition(name, beanDefinition);
}
}
private RootBeanDefinition getBeanDefinition(String name) {
@ -219,11 +222,13 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
if (!this.beanFactory.isAlias(name)
&& !this.beanFactory.containsSingleton(name)) {
RootBeanDefinition beanDefinition = getBeanDefinition(name);
RootBeanDefinition existingDefinition = this.beanDefinitions.put(name,
beanDefinition);
if (existingDefinition != null
&& !beanDefinition.equals(existingDefinition)) {
addBeanTypeForNonAliasDefinition(name, beanDefinition);
if (beanDefinition != null) {
RootBeanDefinition existingDefinition = this.beanDefinitions
.put(name, beanDefinition);
if (existingDefinition != null
&& !beanDefinition.equals(existingDefinition)) {
addBeanTypeForNonAliasDefinition(name, beanDefinition);
}
}
}
}

Loading…
Cancel
Save