atom feed4 messages in edu.oswego.cs.concurrency-interest[concurrency-interest] Gotcha in Conc...
FromSent OnAttachments
Elias RossApr 14, 2006 11:55 am 
Doug LeaApr 14, 2006 1:44 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 (ero@m-Qube.com)
Date:Apr 14, 2006 11:55:37 am
List:edu.oswego.cs.concurrency-interest

Take a look at this:

Map m = new ConcurrentHashMap(); m.put("foo", "bar"); Iterator i = m.entrySet().iterator(); Map.Entry me = (Map.Entry) i.next(); 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:

http://jira.jboss.com/jira/browse/JBAS-2973