Wiki Markup |
---|
Objects that serve as keys in ordered sets and maps shouldmust be immutable. When some fields must be mutable, the {{equals()}}, {{hashCode()}} and {{compareTo()}} methods must consider only immutable state when comparing objects. Violations of this rule can produce inconsistent orderings in collections. The documentation of {{java.util.Interface Set<E>}} and {{java.util.Interface Map<K,V>}} warn against this \[[API 2006|AA. Bibliography#API 06]\]: |
...