commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Parker <>
Subject [collections] ListOrderedMap not respecting underlying list
Date Fri, 10 Jul 2009 01:49:55 GMT

When decorating either CaseInsensitiveMap or IdentityMap (and I believe
this will impact any java.util.TreeMap built with a non-.equals()
Comparator), ListOrderedMap responds inconsistently with the underlying
map.  The ordering seems to be operating off .equals() rather than the
actual contents of the underlying map.

Using CaseInsensitiveMap:
OrderedMap m = ListOrderedMap.decorate(new CaseInsensitiveMap());
m.put("Foo", 1);
m.put("Bar", 2);
//m.firstKey() will return "Foo"

I have JUnit test cases that demonstrate the issue across both
CaseInsensitiveMap and IdentityMap if that would be helpful.

Am I missing something?  Should this be raised as a code issue, or a
documentation enhancement request against ListOrderedMap?

Tom Parker

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

View raw message