ProxyCreationContext uses "ThreadLocal.remove()" over "ThreadLocal.set(null)" as well

This commit is contained in:
Juergen Hoeller 2011-01-05 19:32:02 +00:00
parent 67d9b8b943
commit a780a4a401
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2011 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.
@ -46,7 +46,12 @@ public class ProxyCreationContext {
* @param beanName the name of the bean, or <code>null</code> to reset it
*/
static void setCurrentProxiedBeanName(String beanName) {
currentProxiedBeanName.set(beanName);
if (beanName != null) {
currentProxiedBeanName.set(beanName);
}
else {
currentProxiedBeanName.remove();
}
}
}