Polish "Rename earlyProxyReferences in AbstractAutoProxyCreator"

See gh-23914
This commit is contained in:
Stephane Nicoll 2023-08-23 15:34:22 +02:00
parent 67e3b1b531
commit 5d5cd17d33
1 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
@ -138,8 +138,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
private final Set<String> targetSourcedBeans = Collections.newSetFromMap(new ConcurrentHashMap<>(16));
/** Cache of early target objects: cacheKey to bean instance. */
private final Map<Object, Object> earlyTargetReferences = new ConcurrentHashMap<>(16);
private final Map<Object, Object> earlyBeanReferences = new ConcurrentHashMap<>(16);
private final Map<Object, Class<?>> proxyTypes = new ConcurrentHashMap<>(16);
@ -266,7 +265,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
@Override
public Object getEarlyBeanReference(Object bean, String beanName) {
Object cacheKey = getCacheKey(bean.getClass(), beanName);
this.earlyTargetReferences.put(cacheKey, bean);
this.earlyBeanReferences.put(cacheKey, bean);
return wrapIfNecessary(bean, beanName, cacheKey);
}
@ -315,7 +314,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
public Object postProcessAfterInitialization(@Nullable Object bean, String beanName) {
if (bean != null) {
Object cacheKey = getCacheKey(bean.getClass(), beanName);
if (this.earlyTargetReferences.remove(cacheKey) != bean) {
if (this.earlyBeanReferences.remove(cacheKey) != bean) {
return wrapIfNecessary(bean, beanName, cacheKey);
}
}