From 0b8210093038d408fcd2683ad87b6f8b575f95f3 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 5 Jan 2011 19:32:02 +0000 Subject: [PATCH] ProxyCreationContext uses "ThreadLocal.remove()" over "ThreadLocal.set(null)" as well git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3856 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../aop/framework/autoproxy/ProxyCreationContext.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java b/org.springframework.aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java index 58aefc2b30f..244b1eadd5d 100644 --- a/org.springframework.aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java +++ b/org.springframework.aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java @@ -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 null to reset it */ static void setCurrentProxiedBeanName(String beanName) { - currentProxiedBeanName.set(beanName); + if (beanName != null) { + currentProxiedBeanName.set(beanName); + } + else { + currentProxiedBeanName.remove(); + } } }