Ignore:
Timestamp:
2015-06-03T04:36:57+02:00 (9 years ago)
Author:
Don-vip
Message:

see #11508 - override hashCode() and equals() in other commands as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java

    r8338 r8456  
    382382        return Utils.filter(conflicts, RELATION_FILTER_PREDICATE);
    383383    }
     384
     385    @Override
     386    public int hashCode() {
     387        final int prime = 31;
     388        int result = 1;
     389        result = prime * result + ((conflicts == null) ? 0 : conflicts.hashCode());
     390        result = prime * result + ((listeners == null) ? 0 : listeners.hashCode());
     391        return result;
     392    }
     393
     394    @Override
     395    public boolean equals(Object obj) {
     396        if (this == obj)
     397            return true;
     398        if (obj == null)
     399            return false;
     400        if (getClass() != obj.getClass())
     401            return false;
     402        ConflictCollection other = (ConflictCollection) obj;
     403        if (conflicts == null) {
     404            if (other.conflicts != null)
     405                return false;
     406        } else if (!conflicts.equals(other.conflicts))
     407            return false;
     408        if (listeners == null) {
     409            if (other.listeners != null)
     410                return false;
     411        } else if (!listeners.equals(other.listeners))
     412            return false;
     413        return true;
     414    }
    384415}
Note: See TracChangeset for help on using the changeset viewer.