Further locking optimizations for the retrieval of non-singleton beans

Issue: SPR-12250
(cherry picked from commit 9d83281)
This commit is contained in:
Juergen Hoeller
2014-10-06 17:42:51 +02:00
parent d23b033f61
commit ac4103d1b9
2 changed files with 8 additions and 4 deletions

View File

@@ -959,7 +959,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
@Override
public boolean isActuallyInCreation(String beanName) {
return isSingletonCurrentlyInCreation(beanName) || isPrototypeCurrentlyInCreation(beanName);
return (isSingletonCurrentlyInCreation(beanName) || isPrototypeCurrentlyInCreation(beanName));
}
/**
@@ -1435,7 +1435,9 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @param beanName the name of the bean
*/
protected void markBeanAsCreated(String beanName) {
this.alreadyCreated.add(beanName);
if (!this.alreadyCreated.contains(beanName)) {
this.alreadyCreated.add(beanName);
}
}
/**