Skip to content

Commit a780a4a

Browse files
committed
ProxyCreationContext uses "ThreadLocal.remove()" over "ThreadLocal.set(null)" as well
1 parent 67d9b8b commit a780a4a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

org.springframework.aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,12 @@ public static String getCurrentProxiedBeanName() {
4646
* @param beanName the name of the bean, or <code>null</code> to reset it
4747
*/
4848
static void setCurrentProxiedBeanName(String beanName) {
49-
currentProxiedBeanName.set(beanName);
49+
if (beanName != null) {
50+
currentProxiedBeanName.set(beanName);
51+
}
52+
else {
53+
currentProxiedBeanName.remove();
54+
}
5055
}
5156

5257
}

0 commit comments

Comments
 (0)