commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "christopher marshall" <>
Subject SoftRefHashMap isn't a pure implementation of Map - I'd like to contribute one
Date Fri, 17 May 2002 11:03:57 GMT
All -

Again you may have to excuse my naivety. The 
org.apache.common.collections.SoftRefHashMap is not a "pure" implementation 
of the java.util.Map interface, because the collections returned by the 
"values()" and "entrySet()" methods are not backed by the underlying Map. I 
also believe that the SoftRefHashMap is flawed as keys will not be 
automatically be reclaimed when their value-referents are cleared - the user 
has to manually invoke the purge() method.

I have written an implementation of Map (SoftValueHashMap) which is a pure 
implementation of the java.util.Map interface and which purges itw own keys 
automatically. Also it has a getIfAbsentPut(Object key, ObjectFactory fac) 
method, which is very useful for cache-ing purposes (it is unlikely that a 
Cache will want to return "null" just because an underlying value has been 
de-referenced etc).

I wish to contribute this code to Apache Commons Collections and have been 
looking on the Apache site to see how this is done by a new developer. 
Unforunately I can't find the information. Could someone please tell me the 
etiquette to be followed (presumably I email my source code to an "Admitter" 
who puts it in the nightly-release CVS repository.

Thanks in advance,

Chris Marshall

Get your FREE download of MSN Explorer at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message