Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/imagery
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r9135 r9371 134 134 @Override 135 135 public int hashCode() { 136 final int prime = 31; 137 int result = super.hashCode(); 138 result = prime * result + ((shapes == null) ? 0 : shapes.hashCode()); 139 return result; 136 return Objects.hash(super.hashCode(), shapes); 140 137 } 141 138 142 139 @Override 143 public boolean equals(Object obj) { 144 if (this == obj) 145 return true; 146 if (!super.equals(obj)) 147 return false; 148 if (getClass() != obj.getClass()) 149 return false; 150 ImageryBounds other = (ImageryBounds) obj; 151 if (shapes == null) { 152 if (other.shapes != null) 153 return false; 154 } else if (!shapes.equals(other.shapes)) 155 return false; 156 return true; 140 public boolean equals(Object o) { 141 if (this == o) return true; 142 if (o == null || getClass() != o.getClass()) return false; 143 if (!super.equals(o)) return false; 144 ImageryBounds that = (ImageryBounds) o; 145 return Objects.equals(shapes, that.shapes); 157 146 } 158 147 } … … 457 446 458 447 @Override 459 public boolean equals(Object o) { 460 if (this == o) return true; 461 if (o == null || getClass() != o.getClass()) return false; 462 463 ImageryInfo that = (ImageryInfo) o; 464 465 if (imageryType != that.imageryType) return false; 466 if (url != null ? !url.equals(that.url) : that.url != null) return false; 467 if (name != null ? !name.equals(that.name) : that.name != null) return false; 468 469 return true; 448 public int hashCode() { 449 return Objects.hash(url, imageryType); 470 450 } 471 451 … … 509 489 510 490 @Override 511 public int hashCode() { 512 int result = url != null ? url.hashCode() : 0; 513 result = 31 * result + (imageryType != null ? imageryType.hashCode() : 0); 514 return result; 491 public boolean equals(Object o) { 492 if (this == o) return true; 493 if (o == null || getClass() != o.getClass()) return false; 494 ImageryInfo that = (ImageryInfo) o; 495 return imageryType == that.imageryType && Objects.equals(url, that.url); 515 496 } 516 497 -
trunk/src/org/openstreetmap/josm/data/imagery/Shape.java
r8510 r9371 93 93 @Override 94 94 public int hashCode() { 95 int hash = 5; 96 hash = 47 * hash + Objects.hashCode(this.coords); 97 return hash; 95 return Objects.hash(coords); 98 96 } 99 97 100 98 @Override 101 99 public boolean equals(Object obj) { 102 if (obj == null) { 103 return false; 104 } 105 if (getClass() != obj.getClass()) { 106 return false; 107 } 108 final Shape other = (Shape) obj; 109 if (!Objects.equals(this.coords, other.coords)) { 110 return false; 111 } 112 return true; 100 if (this == obj) return true; 101 if (obj == null || getClass() != obj.getClass()) return false; 102 Shape shape = (Shape) obj; 103 return Objects.equals(coords, shape.coords); 113 104 } 114 105 }
Note:
See TracChangeset
for help on using the changeset viewer.