Skip to content

Rename earlyProxyReferences to earlyBeanReferences in AbstractAutoProxyCreator #23914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport

private final Set<String> targetSourcedBeans = Collections.newSetFromMap(new ConcurrentHashMap<>(16));

private final Map<Object, Object> earlyProxyReferences = 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, Class<?>> proxyTypes = new ConcurrentHashMap<>(16);

Expand Down Expand Up @@ -236,7 +237,7 @@ public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, Strin
@Override
public Object getEarlyBeanReference(Object bean, String beanName) {
Object cacheKey = getCacheKey(bean.getClass(), beanName);
this.earlyProxyReferences.put(cacheKey, bean);
this.earlyTargetReferences.put(cacheKey, bean);
return wrapIfNecessary(bean, beanName, cacheKey);
}

Expand Down Expand Up @@ -295,7 +296,7 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) {
public Object postProcessAfterInitialization(@Nullable Object bean, String beanName) {
if (bean != null) {
Object cacheKey = getCacheKey(bean.getClass(), beanName);
if (this.earlyProxyReferences.remove(cacheKey) != bean) {
if (this.earlyTargetReferences.remove(cacheKey) != bean) {
return wrapIfNecessary(bean, beanName, cacheKey);
}
}
Expand Down