PR: COLLECTIONS-332

Documented the dependency of ListOrderedMap on the standard Map contract of using equals() and hashCode().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/branches/COLLECTIONS_3_2_BRANCH@1079578 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jochen Wiedmann 2011-03-08 22:21:32 +00:00
parent a5f5ec96d1
commit 1c23c026ff
1 changed files with 0 additions and 10 deletions

View File

@ -59,16 +59,6 @@ import org.apache.commons.collections.list.UnmodifiableList;
* using {@link java.util.Collections#synchronizedMap(Map)}. This class may throw
* exceptions when accessed by concurrent threads without synchronization.
* <p>
* <strong>Note that ListOrderedMap doesn't work with {@link IdentityMap},
* {@link CaseInsensitiveMap}, or similar maps that violate the general
* contract of {@link java.util.Map}.</strong> The <code>ListOrderedMap</code>
* (or, more precisely, the underlying <code>List</code>) is relying on
* {@link Object#java.lang.equals(Object) equals()}. This is fine, as long as the
* decorated <code>Map</code> is also based on {@link Object#equals(Object) equals()},
* and {@link Object#hashCode() hashCode()}, which {@link IdentityMap}, and
* {@link CaseInsensitiveMap} don't: The former uses <code>==</code>, and
* the latter uses {@link Object#equals(Object) equals()} on a lowercased
* key.
* <p>
* This class is Serializable from Commons Collections 3.1.
*