Skip to content

Commit 181b680

Browse files
committed
Merge branch '6.1.x'
2 parents 39320b9 + 31f298b commit 181b680

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ NOTE: `ThreadLocal` instances come with serious issues (potentially resulting in
221221
incorrectly using them in multi-threaded and multi-classloader environments. You
222222
should always consider wrapping a `ThreadLocal` in some other class and never directly use
223223
the `ThreadLocal` itself (except in the wrapper class). Also, you should
224-
always remember to correctly set and unset (where the latter simply involves a call to
225-
`ThreadLocal.set(null)`) the resource local to the thread. Unsetting should be done in
224+
always remember to correctly set and unset (where the latter involves a call to
225+
`ThreadLocal.remove()`) the resource local to the thread. Unsetting should be done in
226226
any case, since not unsetting it might result in problematic behavior. Spring's
227227
`ThreadLocal` support does this for you and should always be considered in favor of using
228228
`ThreadLocal` instances without other proper handling code.

spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSourceTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ protected Object determineCurrentLookupKey() {
135135
routingDataSource.setDefaultTargetDataSource(ds);
136136
routingDataSource.setLenientFallback(false);
137137
routingDataSource.afterPropertiesSet();
138-
lookupKey.set(null);
138+
lookupKey.remove();
139139
assertThat(routingDataSource.determineTargetDataSource()).isSameAs(ds);
140140
}
141141

0 commit comments

Comments
 (0)