You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2015/04/07 14:29:46 UTC
svn commit: r1671833 -
/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
Author: tn
Date: Tue Apr 7 12:29:46 2015
New Revision: 1671833
URL: http://svn.apache.org/r1671833
Log:
[COLLECTIONS-543] Do not override equals and hashCode for abstract collections.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java?rev=1671833&r1=1671832&r2=1671833&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java Tue Apr 7 12:29:46 2015
@@ -601,42 +601,6 @@ public class AbstractMultiValuedMap<K, V
}
@Override
- public boolean equals(Object other) {
- final Collection<V> col = getMapping();
- if (col == null) {
- return CollectionUtils.EMPTY_COLLECTION.equals(other);
- }
- if (other == null) {
- return false;
- }
- if(!(other instanceof Collection)){
- return false;
- }
- Collection<?> otherCol = (Collection<?>) other;
- if (CollectionUtils.isEqualCollection(col, otherCol) == false) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- final Collection<V> col = getMapping();
- if (col == null) {
- return CollectionUtils.EMPTY_COLLECTION.hashCode();
- }
- int h = 0;
- Iterator<V> it = col.iterator();
- while (it.hasNext()) {
- V val = it.next();
- if (val != null) {
- h += val.hashCode();
- }
- }
- return h;
- }
-
- @Override
public String toString() {
final Collection<V> col = getMapping();
if (col == null) {