atom feed4 messages in edu.oswego.cs.concurrency-interest[concurrency-interest] Gotcha in Conc...
FromSent OnAttachments
Elias RossApr 14, 2006 11:56 am 
Doug LeaApr 14, 2006 1:45 pm 
Elias RossApr 14, 2006 3:02 pm 
Doug LeaApr 14, 2006 4:20 pm 
Subject:[concurrency-interest] Gotcha in ConcurrentHashMap; need better docs?
From:Elias Ross (
Date:Apr 14, 2006 11:56:00 am

Take a look at this:

Map m = new ConcurrentHashMap(); m.put("foo", "bar"); Iterator i = m.entrySet().iterator(); Map.Entry me = (Map.Entry); m.remove("foo"); // in another thread me.getValue(); // returns null

The JavaDoc:

Like Hashtable but unlike HashMap, this class does NOT allow null to be used as a key or value.

I'm wondering if there was some way to enhance the documentation so that people wouldn't assume that Map.Entry.getValue() never returns null.

JBoss bug: