Update the javadocs on FastThreadLocal (#10942)

Motivation: The writing was unclear.
Modification: Clarified the documentation.
Result: No more ambiguity about what FTL.remove() does.

Fixes #10914
This commit is contained in:
Chris Vest 2021-01-15 12:03:26 +01:00
parent ede5eecf35
commit aed20979e6

View File

@ -208,7 +208,7 @@ public class FastThreadLocal<V> {
}
/**
* @return see {@link InternalThreadLocalMap#setIndexedVariable(int, Object)}.
* @see InternalThreadLocalMap#setIndexedVariable(int, Object).
*/
private void setKnownNotUnset(InternalThreadLocalMap threadLocalMap, V value) {
if (threadLocalMap.setIndexedVariable(index, value)) {
@ -231,15 +231,16 @@ public class FastThreadLocal<V> {
return threadLocalMap != null && threadLocalMap.isIndexedVariableSet(index);
}
/**
* Sets the value to uninitialized; a proceeding call to get() will trigger a call to initialValue().
* Sets the value to uninitialized for the specified thread local map.
* After this, any subsequent call to get() will trigger a new call to initialValue().
*/
public final void remove() {
remove(InternalThreadLocalMap.getIfSet());
}
/**
* Sets the value to uninitialized for the specified thread local map;
* a proceeding call to get() will trigger a call to initialValue().
* Sets the value to uninitialized for the specified thread local map.
* After this, any subsequent call to get() will trigger a new call to initialValue().
* The specified thread local map must be for the current thread.
*/
@SuppressWarnings("unchecked")