Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/data/conflict
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/conflict
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
r9239 r9371 3 3 4 4 import java.util.Map; 5 import java.util.Objects; 5 6 6 7 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 84 85 @Override 85 86 public int hashCode() { 86 final int prime = 31; 87 int result = 1; 88 result = prime * result + ((my == null) ? 0 : my.hashCode()); 89 result = prime * result + ((their == null) ? 0 : their.hashCode()); 90 return result; 87 return Objects.hash(my, their); 91 88 } 92 89 93 @SuppressWarnings("unchecked")94 90 @Override 95 91 public boolean equals(Object obj) { 96 if (this == obj) 97 return true; 98 if (obj == null) 99 return false; 100 if (getClass() != obj.getClass()) 101 return false; 102 Conflict<T> other = (Conflict<T>) obj; 103 if (my != other.my) 104 return false; 105 if (their != other.their) 106 return false; 107 return true; 92 if (this == obj) return true; 93 if (obj == null || getClass() != obj.getClass()) return false; 94 Conflict<?> conflict = (Conflict<?>) obj; 95 return Objects.equals(my, conflict.my) && 96 Objects.equals(their, conflict.their); 108 97 } 109 98 -
trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
r9067 r9371 9 9 import java.util.Iterator; 10 10 import java.util.List; 11 import java.util.Objects; 11 12 import java.util.Set; 12 13 import java.util.concurrent.CopyOnWriteArrayList; … … 386 387 @Override 387 388 public int hashCode() { 388 final int prime = 31; 389 int result = 1; 390 result = prime * result + ((conflicts == null) ? 0 : conflicts.hashCode()); 391 result = prime * result + ((listeners == null) ? 0 : listeners.hashCode()); 392 return result; 389 return Objects.hash(conflicts, listeners); 393 390 } 394 391 395 392 @Override 396 393 public boolean equals(Object obj) { 397 if (this == obj) 398 return true; 399 if (obj == null) 400 return false; 401 if (getClass() != obj.getClass()) 402 return false; 403 ConflictCollection other = (ConflictCollection) obj; 404 if (conflicts == null) { 405 if (other.conflicts != null) 406 return false; 407 } else if (!conflicts.equals(other.conflicts)) 408 return false; 409 if (listeners == null) { 410 if (other.listeners != null) 411 return false; 412 } else if (!listeners.equals(other.listeners)) 413 return false; 414 return true; 394 if (this == obj) return true; 395 if (obj == null || getClass() != obj.getClass()) return false; 396 ConflictCollection conflicts1 = (ConflictCollection) obj; 397 return Objects.equals(conflicts, conflicts1.conflicts) && 398 Objects.equals(listeners, conflicts1.listeners); 415 399 } 416 400 }
Note:
See TracChangeset
for help on using the changeset viewer.