mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Further locking optimizations for the retrieval of non-singleton beans
Issue: SPR-12250
This commit is contained in:
+3
-1
@@ -226,7 +226,9 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
@Override
|
||||
public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException {
|
||||
Object cacheKey = getCacheKey(bean.getClass(), beanName);
|
||||
this.earlyProxyReferences.add(cacheKey);
|
||||
if (!this.earlyProxyReferences.contains(cacheKey)) {
|
||||
this.earlyProxyReferences.add(cacheKey);
|
||||
}
|
||||
return wrapIfNecessary(bean, beanName, cacheKey);
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user