Skip to content

Commit 61ef5a8

Browse files
Seungpangsnicoll
authored andcommitted
Document using ThreadLocal#remove instead of ThreadLocal#set(null)
See gh-32874
1 parent 3b53ee7 commit 61ef5a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ 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
224224
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
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.

0 commit comments

Comments
 (0)