From 3b53ee70387a8ab05108c17d84e6e6cb53a49502 Mon Sep 17 00:00:00 2001 From: Spring Builds Date: Wed, 22 May 2024 16:45:49 +0000 Subject: [PATCH 1/3] Next development version (v6.1.9-SNAPSHOT) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6f22d70055..24b8ce330f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=6.1.8-SNAPSHOT +version=6.1.9-SNAPSHOT org.gradle.caching=true org.gradle.jvmargs=-Xmx2048m From 61ef5a89304054f0339c7fc81ba9789ed7fe7929 Mon Sep 17 00:00:00 2001 From: Seungrae Date: Thu, 23 May 2024 02:00:47 +0900 Subject: [PATCH 2/3] Document using ThreadLocal#remove instead of ThreadLocal#set(null) See gh-32874 --- .../modules/ROOT/pages/core/aop-api/targetsource.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc index 5fd0299a4d..71cb279975 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc @@ -222,7 +222,7 @@ incorrectly using them in multi-threaded and multi-classloader environments. You should always consider wrapping a `ThreadLocal` in some other class and never directly use the `ThreadLocal` itself (except in the wrapper class). Also, you should always remember to correctly set and unset (where the latter simply involves a call to -`ThreadLocal.set(null)`) the resource local to the thread. Unsetting should be done in +`ThreadLocal.remove()`) the resource local to the thread. Unsetting should be done in any case, since not unsetting it might result in problematic behavior. Spring's `ThreadLocal` support does this for you and should always be considered in favor of using `ThreadLocal` instances without other proper handling code. From c01aab58502803ed4a12a360ef8f9ffa140dbb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Thu, 23 May 2024 08:12:14 +0200 Subject: [PATCH 3/3] Polish See gh-32874 --- .../modules/ROOT/pages/core/aop-api/targetsource.adoc | 2 +- .../jdbc/datasource/lookup/AbstractRoutingDataSourceTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc index 71cb279975..5b89165471 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc @@ -221,7 +221,7 @@ NOTE: `ThreadLocal` instances come with serious issues (potentially resulting in incorrectly using them in multi-threaded and multi-classloader environments. You should always consider wrapping a `ThreadLocal` in some other class and never directly use the `ThreadLocal` itself (except in the wrapper class). Also, you should -always remember to correctly set and unset (where the latter simply involves a call to +always remember to correctly set and unset (where the latter involves a call to `ThreadLocal.remove()`) the resource local to the thread. Unsetting should be done in any case, since not unsetting it might result in problematic behavior. Spring's `ThreadLocal` support does this for you and should always be considered in favor of using diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSourceTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSourceTests.java index e639f287d1..0aa39c18c5 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSourceTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSourceTests.java @@ -135,7 +135,7 @@ class AbstractRoutingDataSourceTests { routingDataSource.setDefaultTargetDataSource(ds); routingDataSource.setLenientFallback(false); routingDataSource.afterPropertiesSet(); - lookupKey.set(null); + lookupKey.remove(); assertThat(routingDataSource.determineTargetDataSource()).isSameAs(ds); }