InjectionMetadata caching per bean name needs to refresh when bean class changes
Issue: SPR-11246
This commit is contained in:
@@ -380,10 +380,10 @@ public class PersistenceAnnotationBeanPostProcessor
|
||||
// Fall back to class name as cache key, for backwards compatibility with custom callers.
|
||||
String cacheKey = (StringUtils.hasLength(beanName) ? beanName : clazz.getName());
|
||||
InjectionMetadata metadata = this.injectionMetadataCache.get(cacheKey);
|
||||
if (metadata == null) {
|
||||
if (InjectionMetadata.needsRefresh(metadata, clazz)) {
|
||||
synchronized (this.injectionMetadataCache) {
|
||||
metadata = this.injectionMetadataCache.get(cacheKey);
|
||||
if (metadata == null) {
|
||||
if (InjectionMetadata.needsRefresh(metadata, clazz)) {
|
||||
LinkedList<InjectionMetadata.InjectedElement> elements = new LinkedList<InjectionMetadata.InjectedElement>();
|
||||
Class<?> targetClass = clazz;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user