@ -368,8 +368,18 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
@@ -368,8 +368,18 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
}
afterSingletonCreation(beanName);
}
if(newSingleton){
addSingleton(beanName,singletonObject);
try{
addSingleton(beanName,singletonObject);
}
catch(IllegalStateExceptionex){
// Leniently accept same instance if implicitly appeared.