Thread currentThread = Thread.currentThread();   List heritage = (List) threadMap.get(currentThread); if (heritage == null) { heritage = new ArrayList(); threadMap.put(currentThread, heritage); } heritage.add(this);
  public InheritableThreadLocal()  {		Thread currentThread = Thread.currentThread();		// Note that we don't have to synchronize, as only this thread will    // ever modify the returned heritage and threadMap is a synchronizedMap.    List heritage = (List) threadMap.get(currentThread);    if (heritage == null)      {			heritage = new ArrayList();			threadMap.put(currentThread, heritage);		}		heritage.add(this);	}