Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r10001 r10336 4 4 import java.awt.geom.Rectangle2D; 5 5 import java.util.Arrays; 6 import java.util.Objects; 6 7 7 8 import org.openstreetmap.josm.data.coor.LatLon; … … 266 267 @Override 267 268 public int hashCode() { 268 return (int) (ymin * xmin);269 return Objects.hash(xmin, xmax, ymin, ymax); 269 270 } 270 271 271 272 @Override 272 273 public boolean equals(Object o) { 273 if (o instanceof BBox) { 274 BBox b = (BBox) o; 275 return b.xmax == xmax && b.ymax == ymax 276 && b.xmin == xmin && b.ymin == ymin; 277 } else 278 return false; 274 if (this == o) return true; 275 if (o == null || getClass() != o.getClass()) return false; 276 BBox b = (BBox) o; 277 return Double.compare(b.xmax, xmax) == 0 && Double.compare(b.ymax, ymax) == 0 278 && Double.compare(b.xmin, xmin) == 0 && Double.compare(b.ymin, ymin) == 0; 279 279 } 280 280
Note:
See TracChangeset
for help on using the changeset viewer.