[concurrency-interest] NullPointerExceptioninThreadLocal$ThreadLocalMap.replaceStaleEntry

Thomas Hawtin tackline at tackline.plus.com
Mon Jul 3 10:52:05 EDT 2006

Raj wrote:
> To check if we are facing the "ThreadLocal.initialValue" creating a
> new ThreadLocal bug, we added the following to ThreadLocal.java and
> set it in the boot classpath.

It's not a problem of creating a ThreadLocal within initialValue. The 
problem is initialising a pre-thread value for a ThreadLocal, from 
either set or get.

If you put you logging code in replaceStaleEntry and rehash, I suspect 
you will see a call from initialValue (or no NPE).

Tom Hawtin

More information about the Concurrency-interest mailing list