Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/MultiMap.java
r9074 r9371 9 9 import java.util.Map; 10 10 import java.util.Map.Entry; 11 import java.util.Objects; 11 12 import java.util.Set; 12 13 … … 214 215 @Override 215 216 public int hashCode() { 216 return map.hashCode();217 return Objects.hash(map); 217 218 } 218 219 219 220 @Override 220 221 public boolean equals(Object obj) { 221 if (this == obj) 222 return true; 223 if (obj == null) 224 return false; 225 if (!(obj instanceof MultiMap)) 226 return false; 227 return map.equals(((MultiMap<?, ?>) obj).map); 222 if (this == obj) return true; 223 if (obj == null || getClass() != obj.getClass()) return false; 224 MultiMap<?, ?> multiMap = (MultiMap<?, ?>) obj; 225 return Objects.equals(map, multiMap.map); 228 226 } 229 227 230 228 @Override 229 231 230 public String toString() { 232 231 List<String> entries = new ArrayList<>(map.size()); -
trunk/src/org/openstreetmap/josm/tools/Pair.java
r9246 r9371 3 3 import java.util.ArrayList; 4 4 import java.util.List; 5 import java.util.Objects; 5 6 6 7 /** … … 34 35 @Override 35 36 public int hashCode() { 36 return a.hashCode() + b.hashCode();37 return Objects.hash(a, b); 37 38 } 38 39 39 40 @Override 40 41 public boolean equals(Object other) { 41 if ( other instanceof Pair<?, ?>) {42 Pair<?, ?> o = (Pair<?, ?>) other;43 return a.equals(o.a) && b.equals(o.b);44 } else45 return false;42 if (this == other) return true; 43 if (other == null || getClass() != other.getClass()) return false; 44 Pair<?, ?> pair = (Pair<?, ?>) other; 45 return Objects.equals(a, pair.a) && 46 Objects.equals(b, pair.b); 46 47 } 47 48
Note:
See TracChangeset
for help on using the changeset viewer.