File tree 2 files changed +3
-3
lines changed
framework-docs/modules/ROOT/pages/core/aop-api
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -221,8 +221,8 @@ NOTE: `ThreadLocal` instances come with serious issues (potentially resulting in
221
221
incorrectly using them in multi-threaded and multi-classloader environments. You
222
222
should always consider wrapping a `ThreadLocal` in some other class and never directly use
223
223
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
226
226
any case, since not unsetting it might result in problematic behavior. Spring's
227
227
`ThreadLocal` support does this for you and should always be considered in favor of using
228
228
`ThreadLocal` instances without other proper handling code.
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ protected Object determineCurrentLookupKey() {
135
135
routingDataSource .setDefaultTargetDataSource (ds );
136
136
routingDataSource .setLenientFallback (false );
137
137
routingDataSource .afterPropertiesSet ();
138
- lookupKey .set ( null );
138
+ lookupKey .remove ( );
139
139
assertThat (routingDataSource .determineTargetDataSource ()).isSameAs (ds );
140
140
}
141
141
You can’t perform that action at this time.
0 commit comments