Self reference detection defensively handles null bean names
Issue: SPR-12018
This commit is contained in:
parent
0ce90f1d16
commit
fe05e7e5b3
|
|
@ -1244,15 +1244,9 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
|||
* on the original bean.
|
||||
*/
|
||||
private boolean isSelfReference(String beanName, String candidateName) {
|
||||
if (beanName.equals(candidateName)) {
|
||||
return true;
|
||||
}
|
||||
if (candidateName != null && containsBeanDefinition(candidateName)) {
|
||||
if (beanName.equals(getMergedLocalBeanDefinition(candidateName).getFactoryBeanName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return (beanName != null && candidateName != null &&
|
||||
(beanName.equals(candidateName) || (containsBeanDefinition(candidateName) &&
|
||||
beanName.equals(getMergedLocalBeanDefinition(candidateName).getFactoryBeanName()))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue