Merge branch '5.1.x'
# Conflicts: # build.gradle # spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java # spring-aspects/spring-aspects.gradle # spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java # spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java # spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java # spring-orm/spring-orm.gradle # spring-test/spring-test.gradle
This commit is contained in:
@@ -87,25 +87,26 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing
|
||||
@Override
|
||||
@Nullable
|
||||
public Cache getCache(String name) {
|
||||
// Quick check for existing cache...
|
||||
Cache cache = this.cacheMap.get(name);
|
||||
if (cache != null) {
|
||||
return cache;
|
||||
}
|
||||
else {
|
||||
// Fully synchronize now for missing cache creation...
|
||||
|
||||
// The provider may support on-demand cache creation...
|
||||
Cache missingCache = getMissingCache(name);
|
||||
if (missingCache != null) {
|
||||
// Fully synchronize now for missing cache registration
|
||||
synchronized (this.cacheMap) {
|
||||
cache = this.cacheMap.get(name);
|
||||
if (cache == null) {
|
||||
cache = getMissingCache(name);
|
||||
if (cache != null) {
|
||||
cache = decorateCache(cache);
|
||||
this.cacheMap.put(name, cache);
|
||||
updateCacheNames(name);
|
||||
}
|
||||
cache = decorateCache(missingCache);
|
||||
this.cacheMap.put(name, cache);
|
||||
updateCacheNames(name);
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
Reference in New Issue
Block a user