Josh Bloch writes:
I think we (the JSR-166 EG) were sloppy when specifying
ThreadLocal.remove. Here's what the spec currently says:
/**
* Removes the value for this ThreadLocal. This may help reduce
* the storage requirements of ThreadLocals. If this ThreadLocal
* is accessed again, it will by default have its
* <tt>initialValue</tt>.
* @since 1.5
**/
I think that we should tighten this up, preferably in the next update release:
/**
* Removes the current thread's value for this thread-local variable.
* If this thread-local variable is subsequently read by the current
* thread, its initial value will be computed by invoking its
* {@link #initialValue} method again unless its value is set by
* the current thread in the interim.
*
* @since 1.5
*/
###@###.### 10/27/04 01:32 GMT
I think we (the JSR-166 EG) were sloppy when specifying
ThreadLocal.remove. Here's what the spec currently says:
/**
* Removes the value for this ThreadLocal. This may help reduce
* the storage requirements of ThreadLocals. If this ThreadLocal
* is accessed again, it will by default have its
* <tt>initialValue</tt>.
* @since 1.5
**/
I think that we should tighten this up, preferably in the next update release:
/**
* Removes the current thread's value for this thread-local variable.
* If this thread-local variable is subsequently read by the current
* thread, its initial value will be computed by invoking its
* {@link #initialValue} method again unless its value is set by
* the current thread in the interim.
*
* @since 1.5
*/
###@###.### 10/27/04 01:32 GMT