Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2016-01-09T23:20:37+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/command
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/AddCommand.java
r8510 r9371 7 7 import java.util.Collection; 8 8 import java.util.Collections; 9 import java.util.Objects; 9 10 10 11 import javax.swing.Icon; … … 99 100 @Override 100 101 public int hashCode() { 101 final int prime = 31; 102 int result = super.hashCode(); 103 result = prime * result + ((osm == null) ? 0 : osm.hashCode()); 104 return result; 102 return Objects.hash(super.hashCode(), osm); 105 103 } 106 104 107 105 @Override 108 106 public boolean equals(Object obj) { 109 if (this == obj) 110 return true; 111 if (!super.equals(obj)) 112 return false; 113 if (getClass() != obj.getClass()) 114 return false; 115 AddCommand other = (AddCommand) obj; 116 if (osm == null) { 117 if (other.osm != null) 118 return false; 119 } else if (!osm.equals(other.osm)) 120 return false; 121 return true; 107 if (this == obj) return true; 108 if (obj == null || getClass() != obj.getClass()) return false; 109 if (!super.equals(obj)) return false; 110 AddCommand that = (AddCommand) obj; 111 return Objects.equals(osm, that.osm); 122 112 } 123 113 } -
trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
r8840 r9371 8 8 import java.util.HashSet; 9 9 import java.util.List; 10 import java.util.Objects; 10 11 11 12 import javax.swing.Icon; … … 176 177 @Override 177 178 public int hashCode() { 178 final int prime = 31; 179 int result = super.hashCode(); 180 result = prime * result + ((createdPrimitives == null) ? 0 : createdPrimitives.hashCode()); 181 result = prime * result + ((createdPrimitivesToSelect == null) ? 0 : createdPrimitivesToSelect.hashCode()); 182 result = prime * result + ((data == null) ? 0 : data.hashCode()); 183 result = prime * result + ((toSelect == null) ? 0 : toSelect.hashCode()); 184 return result; 179 return Objects.hash(super.hashCode(), data, toSelect, createdPrimitives, createdPrimitivesToSelect); 185 180 } 186 181 187 182 @Override 188 183 public boolean equals(Object obj) { 189 if (this == obj) 190 return true; 191 if (!super.equals(obj)) 192 return false; 193 if (getClass() != obj.getClass()) 194 return false; 195 AddPrimitivesCommand other = (AddPrimitivesCommand) obj; 196 if (createdPrimitives == null) { 197 if (other.createdPrimitives != null) 198 return false; 199 } else if (!createdPrimitives.equals(other.createdPrimitives)) 200 return false; 201 if (createdPrimitivesToSelect == null) { 202 if (other.createdPrimitivesToSelect != null) 203 return false; 204 } else if (!createdPrimitivesToSelect.equals(other.createdPrimitivesToSelect)) 205 return false; 206 if (data == null) { 207 if (other.data != null) 208 return false; 209 } else if (!data.equals(other.data)) 210 return false; 211 if (toSelect == null) { 212 if (other.toSelect != null) 213 return false; 214 } else if (!toSelect.equals(other.toSelect)) 215 return false; 216 return true; 184 if (this == obj) return true; 185 if (obj == null || getClass() != obj.getClass()) return false; 186 if (!super.equals(obj)) return false; 187 AddPrimitivesCommand that = (AddPrimitivesCommand) obj; 188 return Objects.equals(data, that.data) && 189 Objects.equals(toSelect, that.toSelect) && 190 Objects.equals(createdPrimitives, that.createdPrimitives) && 191 Objects.equals(createdPrimitivesToSelect, that.createdPrimitivesToSelect); 217 192 } 218 193 } -
trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
r8510 r9371 6 6 7 7 import java.util.Collection; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 91 92 @Override 92 93 public int hashCode() { 93 final int prime = 31; 94 int result = super.hashCode(); 95 result = prime * result + ((newOsm == null) ? 0 : newOsm.hashCode()); 96 result = prime * result + ((osm == null) ? 0 : osm.hashCode()); 97 return result; 94 return Objects.hash(super.hashCode(), osm, newOsm); 98 95 } 99 96 100 97 @Override 101 98 public boolean equals(Object obj) { 102 if (this == obj) 103 return true; 104 if (!super.equals(obj)) 105 return false; 106 if (getClass() != obj.getClass()) 107 return false; 108 ChangeCommand other = (ChangeCommand) obj; 109 if (newOsm == null) { 110 if (other.newOsm != null) 111 return false; 112 } else if (!newOsm.equals(other.newOsm)) 113 return false; 114 if (osm == null) { 115 if (other.osm != null) 116 return false; 117 } else if (!osm.equals(other.osm)) 118 return false; 119 return true; 99 if (this == obj) return true; 100 if (obj == null || getClass() != obj.getClass()) return false; 101 if (!super.equals(obj)) return false; 102 ChangeCommand that = (ChangeCommand) obj; 103 return Objects.equals(osm, that.osm) && 104 Objects.equals(newOsm, that.newOsm); 120 105 } 121 106 } -
trunk/src/org/openstreetmap/josm/command/ChangeNodesCommand.java
r8456 r9371 6 6 import java.util.Collection; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 64 65 @Override 65 66 public int hashCode() { 66 final int prime = 31; 67 int result = super.hashCode(); 68 result = prime * result + ((newNodes == null) ? 0 : newNodes.hashCode()); 69 result = prime * result + ((way == null) ? 0 : way.hashCode()); 70 return result; 67 return Objects.hash(super.hashCode(), way, newNodes); 71 68 } 72 69 73 70 @Override 74 71 public boolean equals(Object obj) { 75 if (this == obj) 76 return true; 77 if (!super.equals(obj)) 78 return false; 79 if (getClass() != obj.getClass()) 80 return false; 81 ChangeNodesCommand other = (ChangeNodesCommand) obj; 82 if (newNodes == null) { 83 if (other.newNodes != null) 84 return false; 85 } else if (!newNodes.equals(other.newNodes)) 86 return false; 87 if (way == null) { 88 if (other.way != null) 89 return false; 90 } else if (!way.equals(other.way)) 91 return false; 92 return true; 72 if (this == obj) return true; 73 if (obj == null || getClass() != obj.getClass()) return false; 74 if (!super.equals(obj)) return false; 75 ChangeNodesCommand that = (ChangeNodesCommand) obj; 76 return Objects.equals(way, that.way) && 77 Objects.equals(newNodes, that.newNodes); 93 78 } 94 79 } -
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r8975 r9371 14 14 import java.util.List; 15 15 import java.util.Map; 16 import java.util.Objects; 16 17 17 18 import javax.swing.Icon; … … 249 250 @Override 250 251 public int hashCode() { 251 final int prime = 31; 252 int result = super.hashCode(); 253 result = prime * result + ((objects == null) ? 0 : objects.hashCode()); 254 result = prime * result + ((tags == null) ? 0 : tags.hashCode()); 255 return result; 252 return Objects.hash(super.hashCode(), objects, tags); 256 253 } 257 254 258 255 @Override 259 256 public boolean equals(Object obj) { 260 if (this == obj) 261 return true; 262 if (!super.equals(obj)) 263 return false; 264 if (getClass() != obj.getClass()) 265 return false; 266 ChangePropertyCommand other = (ChangePropertyCommand) obj; 267 if (objects == null) { 268 if (other.objects != null) 269 return false; 270 } else if (!objects.equals(other.objects)) 271 return false; 272 if (tags == null) { 273 if (other.tags != null) 274 return false; 275 } else if (!tags.equals(other.tags)) 276 return false; 277 return true; 257 if (this == obj) return true; 258 if (obj == null || getClass() != obj.getClass()) return false; 259 if (!super.equals(obj)) return false; 260 ChangePropertyCommand that = (ChangePropertyCommand) obj; 261 return Objects.equals(objects, that.objects) && 262 Objects.equals(tags, that.tags); 278 263 } 279 264 } -
trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java
r8846 r9371 10 10 import java.util.LinkedList; 11 11 import java.util.List; 12 import java.util.Objects; 12 13 13 14 import javax.swing.Icon; … … 129 130 @Override 130 131 public int hashCode() { 131 final int prime = 31; 132 int result = super.hashCode(); 133 result = prime * result + ((key == null) ? 0 : key.hashCode()); 134 result = prime * result + ((newKey == null) ? 0 : newKey.hashCode()); 135 result = prime * result + ((objects == null) ? 0 : objects.hashCode()); 136 return result; 132 return Objects.hash(super.hashCode(), objects, key, newKey); 137 133 } 138 134 139 135 @Override 140 136 public boolean equals(Object obj) { 141 if (this == obj) 142 return true; 143 if (!super.equals(obj)) 144 return false; 145 if (getClass() != obj.getClass()) 146 return false; 147 ChangePropertyKeyCommand other = (ChangePropertyKeyCommand) obj; 148 if (key == null) { 149 if (other.key != null) 150 return false; 151 } else if (!key.equals(other.key)) 152 return false; 153 if (newKey == null) { 154 if (other.newKey != null) 155 return false; 156 } else if (!newKey.equals(other.newKey)) 157 return false; 158 if (objects == null) { 159 if (other.objects != null) 160 return false; 161 } else if (!objects.equals(other.objects)) 162 return false; 163 return true; 137 if (this == obj) return true; 138 if (obj == null || getClass() != obj.getClass()) return false; 139 if (!super.equals(obj)) return false; 140 ChangePropertyKeyCommand that = (ChangePropertyKeyCommand) obj; 141 return Objects.equals(objects, that.objects) && 142 Objects.equals(key, that.key) && 143 Objects.equals(newKey, that.newKey); 164 144 } 165 145 } -
trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java
r9067 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import javax.swing.Icon; … … 84 85 @Override 85 86 public int hashCode() { 86 final int prime = 31; 87 int result = super.hashCode(); 88 result = prime * result + ((newRole == null) ? 0 : newRole.hashCode()); 89 result = prime * result + ((oldModified == null) ? 0 : oldModified.hashCode()); 90 result = prime * result + ((oldRole == null) ? 0 : oldRole.hashCode()); 91 result = prime * result + position; 92 result = prime * result + ((relation == null) ? 0 : relation.hashCode()); 93 return result; 87 return Objects.hash(super.hashCode(), relation, position, newRole, oldRole, oldModified); 94 88 } 95 89 96 90 @Override 97 91 public boolean equals(Object obj) { 98 if (this == obj) 99 return true; 100 if (!super.equals(obj)) 101 return false; 102 if (getClass() != obj.getClass()) 103 return false; 104 ChangeRelationMemberRoleCommand other = (ChangeRelationMemberRoleCommand) obj; 105 if (newRole == null) { 106 if (other.newRole != null) 107 return false; 108 } else if (!newRole.equals(other.newRole)) 109 return false; 110 if (oldModified == null) { 111 if (other.oldModified != null) 112 return false; 113 } else if (!oldModified.equals(other.oldModified)) 114 return false; 115 if (oldRole == null) { 116 if (other.oldRole != null) 117 return false; 118 } else if (!oldRole.equals(other.oldRole)) 119 return false; 120 if (position != other.position) 121 return false; 122 if (relation == null) { 123 if (other.relation != null) 124 return false; 125 } else if (!relation.equals(other.relation)) 126 return false; 127 return true; 92 if (this == obj) return true; 93 if (obj == null || getClass() != obj.getClass()) return false; 94 if (!super.equals(obj)) return false; 95 ChangeRelationMemberRoleCommand that = (ChangeRelationMemberRoleCommand) obj; 96 return position == that.position && 97 Objects.equals(relation, that.relation) && 98 Objects.equals(newRole, that.newRole) && 99 Objects.equals(oldRole, that.oldRole) && 100 Objects.equals(oldModified, that.oldModified); 128 101 } 129 102 } -
trunk/src/org/openstreetmap/josm/command/Command.java
r8945 r9371 9 9 import java.util.Map; 10 10 import java.util.Map.Entry; 11 import java.util.Objects; 11 12 12 13 import javax.swing.JOptionPane; … … 105 106 @Override 106 107 public int hashCode() { 107 final int prime = 31; 108 int result = 1; 109 result = prime * result + ((eastNorth == null) ? 0 : eastNorth.hashCode()); 110 result = prime * result + ((latlon == null) ? 0 : latlon.hashCode()); 111 result = prime * result + (modified ? 1231 : 1237); 112 return result; 108 return Objects.hash(latlon, eastNorth, modified); 113 109 } 114 110 115 111 @Override 116 112 public boolean equals(Object obj) { 117 if (this == obj) 118 return true; 119 if (obj == null) 120 return false; 121 if (getClass() != obj.getClass()) 122 return false; 123 OldNodeState other = (OldNodeState) obj; 124 if (eastNorth == null) { 125 if (other.eastNorth != null) 126 return false; 127 } else if (!eastNorth.equals(other.eastNorth)) 128 return false; 129 if (latlon == null) { 130 if (other.latlon != null) 131 return false; 132 } else if (!latlon.equals(other.latlon)) 133 return false; 134 if (modified != other.modified) 135 return false; 136 return true; 113 if (this == obj) return true; 114 if (obj == null || getClass() != obj.getClass()) return false; 115 OldNodeState that = (OldNodeState) obj; 116 return modified == that.modified && 117 Objects.equals(latlon, that.latlon) && 118 Objects.equals(eastNorth, that.eastNorth); 137 119 } 138 120 } … … 306 288 @Override 307 289 public int hashCode() { 308 final int prime = 31; 309 int result = 1; 310 result = prime * result + ((cloneMap == null) ? 0 : cloneMap.hashCode()); 311 result = prime * result + ((layer == null) ? 0 : layer.hashCode()); 312 return result; 290 return Objects.hash(cloneMap, layer); 313 291 } 314 292 315 293 @Override 316 294 public boolean equals(Object obj) { 317 if (this == obj) 318 return true; 319 if (obj == null) 320 return false; 321 if (getClass() != obj.getClass()) 322 return false; 323 Command other = (Command) obj; 324 if (cloneMap == null) { 325 if (other.cloneMap != null) 326 return false; 327 } else if (!cloneMap.equals(other.cloneMap)) 328 return false; 329 if (layer == null) { 330 if (other.layer != null) 331 return false; 332 } else if (!layer.equals(other.layer)) 333 return false; 334 return true; 295 if (this == obj) return true; 296 if (obj == null || getClass() != obj.getClass()) return false; 297 Command command = (Command) obj; 298 return Objects.equals(cloneMap, command.cloneMap) && 299 Objects.equals(layer, command.layer); 335 300 } 336 301 } -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r9072 r9371 18 18 import java.util.Map; 19 19 import java.util.Map.Entry; 20 import java.util.Objects; 20 21 import java.util.Set; 21 22 … … 518 519 @Override 519 520 public int hashCode() { 520 final int prime = 31; 521 int result = super.hashCode(); 522 result = prime * result + ((clonedPrimitives == null) ? 0 : clonedPrimitives.hashCode()); 523 result = prime * result + ((toDelete == null) ? 0 : toDelete.hashCode()); 524 return result; 521 return Objects.hash(super.hashCode(), toDelete, clonedPrimitives); 525 522 } 526 523 527 524 @Override 528 525 public boolean equals(Object obj) { 529 if (this == obj) 530 return true; 531 if (!super.equals(obj)) 532 return false; 533 if (getClass() != obj.getClass()) 534 return false; 535 DeleteCommand other = (DeleteCommand) obj; 536 if (clonedPrimitives == null) { 537 if (other.clonedPrimitives != null) 538 return false; 539 } else if (!clonedPrimitives.equals(other.clonedPrimitives)) 540 return false; 541 if (toDelete == null) { 542 if (other.toDelete != null) 543 return false; 544 } else if (!toDelete.equals(other.toDelete)) 545 return false; 546 return true; 526 if (this == obj) return true; 527 if (obj == null || getClass() != obj.getClass()) return false; 528 if (!super.equals(obj)) return false; 529 DeleteCommand that = (DeleteCommand) obj; 530 return Objects.equals(toDelete, that.toDelete) && 531 Objects.equals(clonedPrimitives, that.clonedPrimitives); 547 532 } 548 533 } -
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r9231 r9371 9 9 import java.util.LinkedList; 10 10 import java.util.List; 11 import java.util.Objects; 11 12 12 13 import javax.swing.Icon; … … 246 247 @Override 247 248 public int hashCode() { 248 final int prime = 31; 249 int result = super.hashCode(); 250 long temp; 251 temp = Double.doubleToLongBits(backupX); 252 result = prime * result + (int) (temp ^ (temp >>> 32)); 253 temp = Double.doubleToLongBits(backupY); 254 result = prime * result + (int) (temp ^ (temp >>> 32)); 255 result = prime * result + ((nodes == null) ? 0 : nodes.hashCode()); 256 result = prime * result + ((oldState == null) ? 0 : oldState.hashCode()); 257 result = prime * result + ((startEN == null) ? 0 : startEN.hashCode()); 258 temp = Double.doubleToLongBits(x); 259 result = prime * result + (int) (temp ^ (temp >>> 32)); 260 temp = Double.doubleToLongBits(y); 261 result = prime * result + (int) (temp ^ (temp >>> 32)); 262 return result; 249 return Objects.hash(super.hashCode(), nodes, startEN, x, y, backupX, backupY, oldState); 263 250 } 264 251 265 252 @Override 266 253 public boolean equals(Object obj) { 267 if (this == obj) 268 return true; 269 if (!super.equals(obj)) 270 return false; 271 if (getClass() != obj.getClass()) 272 return false; 273 MoveCommand other = (MoveCommand) obj; 274 if (Double.doubleToLongBits(backupX) != Double.doubleToLongBits(other.backupX)) 275 return false; 276 if (Double.doubleToLongBits(backupY) != Double.doubleToLongBits(other.backupY)) 277 return false; 278 if (nodes == null) { 279 if (other.nodes != null) 280 return false; 281 } else if (!nodes.equals(other.nodes)) 282 return false; 283 if (oldState == null) { 284 if (other.oldState != null) 285 return false; 286 } else if (!oldState.equals(other.oldState)) 287 return false; 288 if (startEN == null) { 289 if (other.startEN != null) 290 return false; 291 } else if (!startEN.equals(other.startEN)) 292 return false; 293 if (Double.doubleToLongBits(x) != Double.doubleToLongBits(other.x)) 294 return false; 295 if (Double.doubleToLongBits(y) != Double.doubleToLongBits(other.y)) 296 return false; 297 return true; 254 if (this == obj) return true; 255 if (obj == null || getClass() != obj.getClass()) return false; 256 if (!super.equals(obj)) return false; 257 MoveCommand that = (MoveCommand) obj; 258 return Double.compare(that.x, x) == 0 && 259 Double.compare(that.y, y) == 0 && 260 Double.compare(that.backupX, backupX) == 0 && 261 Double.compare(that.backupY, backupY) == 0 && 262 Objects.equals(nodes, that.nodes) && 263 Objects.equals(startEN, that.startEN) && 264 Objects.equals(oldState, that.oldState); 298 265 } 299 266 } -
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r9243 r9371 11 11 import java.util.List; 12 12 import java.util.Map; 13 import java.util.Objects; 13 14 import java.util.Set; 14 15 … … 279 280 @Override 280 281 public int hashCode() { 281 final int prime = 31; 282 int result = super.hashCode(); 283 result = prime * result + ((ds == null) ? 0 : ds.hashCode()); 284 result = prime * result + ((makeIncompleteData == null) ? 0 : makeIncompleteData.hashCode()); 285 result = prime * result + ((makeIncompleteDataByPrimId == null) ? 0 : makeIncompleteDataByPrimId.hashCode()); 286 result = prime * result + ((purgedConflicts == null) ? 0 : purgedConflicts.hashCode()); 287 result = prime * result + ((toPurge == null) ? 0 : toPurge.hashCode()); 288 return result; 282 return Objects.hash(super.hashCode(), toPurge, makeIncompleteData, makeIncompleteDataByPrimId, purgedConflicts, ds); 289 283 } 290 284 291 285 @Override 292 286 public boolean equals(Object obj) { 293 if (this == obj) 294 return true; 295 if (!super.equals(obj)) 296 return false; 297 if (getClass() != obj.getClass()) 298 return false; 299 PurgeCommand other = (PurgeCommand) obj; 300 if (ds == null) { 301 if (other.ds != null) 302 return false; 303 } else if (!ds.equals(other.ds)) 304 return false; 305 if (makeIncompleteData == null) { 306 if (other.makeIncompleteData != null) 307 return false; 308 } else if (!makeIncompleteData.equals(other.makeIncompleteData)) 309 return false; 310 if (makeIncompleteDataByPrimId == null) { 311 if (other.makeIncompleteDataByPrimId != null) 312 return false; 313 } else if (!makeIncompleteDataByPrimId.equals(other.makeIncompleteDataByPrimId)) 314 return false; 315 if (purgedConflicts == null) { 316 if (other.purgedConflicts != null) 317 return false; 318 } else if (!purgedConflicts.equals(other.purgedConflicts)) 319 return false; 320 if (toPurge == null) { 321 if (other.toPurge != null) 322 return false; 323 } else if (!toPurge.equals(other.toPurge)) 324 return false; 325 return true; 287 if (this == obj) return true; 288 if (obj == null || getClass() != obj.getClass()) return false; 289 if (!super.equals(obj)) return false; 290 PurgeCommand that = (PurgeCommand) obj; 291 return Objects.equals(toPurge, that.toPurge) && 292 Objects.equals(makeIncompleteData, that.makeIncompleteData) && 293 Objects.equals(makeIncompleteDataByPrimId, that.makeIncompleteDataByPrimId) && 294 Objects.equals(purgedConflicts, that.purgedConflicts) && 295 Objects.equals(ds, that.ds); 326 296 } 327 297 } -
trunk/src/org/openstreetmap/josm/command/RemoveNodesCommand.java
r8456 r9371 7 7 import java.util.HashSet; 8 8 import java.util.List; 9 import java.util.Objects; 9 10 import java.util.Set; 10 11 … … 65 66 @Override 66 67 public int hashCode() { 67 final int prime = 31; 68 int result = super.hashCode(); 69 result = prime * result + ((rmNodes == null) ? 0 : rmNodes.hashCode()); 70 result = prime * result + ((way == null) ? 0 : way.hashCode()); 71 return result; 68 return Objects.hash(super.hashCode(), way, rmNodes); 72 69 } 73 70 74 71 @Override 75 72 public boolean equals(Object obj) { 76 if (this == obj) 77 return true; 78 if (!super.equals(obj)) 79 return false; 80 if (getClass() != obj.getClass()) 81 return false; 82 RemoveNodesCommand other = (RemoveNodesCommand) obj; 83 if (rmNodes == null) { 84 if (other.rmNodes != null) 85 return false; 86 } else if (!rmNodes.equals(other.rmNodes)) 87 return false; 88 if (way == null) { 89 if (other.way != null) 90 return false; 91 } else if (!way.equals(other.way)) 92 return false; 93 return true; 73 if (this == obj) return true; 74 if (obj == null || getClass() != obj.getClass()) return false; 75 if (!super.equals(obj)) return false; 76 RemoveNodesCommand that = (RemoveNodesCommand) obj; 77 return Objects.equals(way, that.way) && 78 Objects.equals(rmNodes, that.rmNodes); 94 79 } 95 80 } -
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r9243 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import org.openstreetmap.josm.data.coor.EastNorth; … … 93 94 @Override 94 95 public int hashCode() { 95 final int prime = 31; 96 int result = super.hashCode(); 97 result = prime * result + ((pivot == null) ? 0 : pivot.hashCode()); 98 long temp; 99 temp = Double.doubleToLongBits(rotationAngle); 100 result = prime * result + (int) (temp ^ (temp >>> 32)); 101 temp = Double.doubleToLongBits(startAngle); 102 result = prime * result + (int) (temp ^ (temp >>> 32)); 103 return result; 96 return Objects.hash(super.hashCode(), pivot, startAngle, rotationAngle); 104 97 } 105 98 106 99 @Override 107 100 public boolean equals(Object obj) { 108 if (this == obj) 109 return true; 110 if (!super.equals(obj)) 111 return false; 112 if (getClass() != obj.getClass()) 113 return false; 114 RotateCommand other = (RotateCommand) obj; 115 if (pivot == null) { 116 if (other.pivot != null) 117 return false; 118 } else if (!pivot.equals(other.pivot)) 119 return false; 120 if (Double.doubleToLongBits(rotationAngle) != Double.doubleToLongBits(other.rotationAngle)) 121 return false; 122 if (Double.doubleToLongBits(startAngle) != Double.doubleToLongBits(other.startAngle)) 123 return false; 124 return true; 101 if (this == obj) return true; 102 if (obj == null || getClass() != obj.getClass()) return false; 103 if (!super.equals(obj)) return false; 104 RotateCommand that = (RotateCommand) obj; 105 return Double.compare(that.startAngle, startAngle) == 0 && 106 Double.compare(that.rotationAngle, rotationAngle) == 0 && 107 Objects.equals(pivot, that.pivot); 125 108 } 126 109 } -
trunk/src/org/openstreetmap/josm/command/ScaleCommand.java
r9243 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import org.openstreetmap.josm.data.coor.EastNorth; … … 83 84 @Override 84 85 public int hashCode() { 85 final int prime = 31; 86 int result = super.hashCode(); 87 result = prime * result + ((pivot == null) ? 0 : pivot.hashCode()); 88 long temp; 89 temp = Double.doubleToLongBits(scalingFactor); 90 result = prime * result + (int) (temp ^ (temp >>> 32)); 91 result = prime * result + ((startEN == null) ? 0 : startEN.hashCode()); 92 return result; 86 return Objects.hash(super.hashCode(), pivot, scalingFactor, startEN); 93 87 } 94 88 95 89 @Override 96 90 public boolean equals(Object obj) { 97 if (this == obj) 98 return true; 99 if (!super.equals(obj)) 100 return false; 101 if (getClass() != obj.getClass()) 102 return false; 103 ScaleCommand other = (ScaleCommand) obj; 104 if (pivot == null) { 105 if (other.pivot != null) 106 return false; 107 } else if (!pivot.equals(other.pivot)) 108 return false; 109 if (Double.doubleToLongBits(scalingFactor) != Double.doubleToLongBits(other.scalingFactor)) 110 return false; 111 if (startEN == null) { 112 if (other.startEN != null) 113 return false; 114 } else if (!startEN.equals(other.startEN)) 115 return false; 116 return true; 91 if (this == obj) return true; 92 if (obj == null || getClass() != obj.getClass()) return false; 93 if (!super.equals(obj)) return false; 94 ScaleCommand that = (ScaleCommand) obj; 95 return Double.compare(that.scalingFactor, scalingFactor) == 0 && 96 Objects.equals(pivot, that.pivot) && 97 Objects.equals(startEN, that.startEN); 117 98 } 118 99 } -
trunk/src/org/openstreetmap/josm/command/SelectCommand.java
r8456 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import org.openstreetmap.josm.Main; … … 54 55 @Override 55 56 public int hashCode() { 56 final int prime = 31; 57 int result = super.hashCode(); 58 result = prime * result + ((newSelection == null) ? 0 : newSelection.hashCode()); 59 result = prime * result + ((oldSelection == null) ? 0 : oldSelection.hashCode()); 60 return result; 57 return Objects.hash(super.hashCode(), newSelection, oldSelection); 61 58 } 62 59 63 60 @Override 64 61 public boolean equals(Object obj) { 65 if (this == obj) 66 return true; 67 if (!super.equals(obj)) 68 return false; 69 if (getClass() != obj.getClass()) 70 return false; 71 SelectCommand other = (SelectCommand) obj; 72 if (newSelection == null) { 73 if (other.newSelection != null) 74 return false; 75 } else if (!newSelection.equals(other.newSelection)) 76 return false; 77 if (oldSelection == null) { 78 if (other.oldSelection != null) 79 return false; 80 } else if (!oldSelection.equals(other.oldSelection)) 81 return false; 82 return true; 62 if (this == obj) return true; 63 if (obj == null || getClass() != obj.getClass()) return false; 64 if (!super.equals(obj)) return false; 65 SelectCommand that = (SelectCommand) obj; 66 return Objects.equals(newSelection, that.newSelection) && 67 Objects.equals(oldSelection, that.oldSelection); 83 68 } 84 69 } -
trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
r8840 r9371 7 7 import java.util.Collection; 8 8 import java.util.HashSet; 9 import java.util.Objects; 9 10 10 11 import javax.swing.Icon; … … 126 127 @Override 127 128 public int hashCode() { 128 final int prime = 31; 129 int result = super.hashCode(); 130 result = prime * result + (continueOnError ? 1231 : 1237); 131 result = prime * result + ((name == null) ? 0 : name.hashCode()); 132 result = prime * result + Arrays.hashCode(sequence); 133 result = prime * result + (sequenceComplete ? 1231 : 1237); 134 return result; 129 return Objects.hash(super.hashCode(), sequence, sequenceComplete, name, continueOnError); 135 130 } 136 131 137 132 @Override 138 133 public boolean equals(Object obj) { 139 if (this == obj) 140 return true; 141 if (!super.equals(obj)) 142 return false; 143 if (getClass() != obj.getClass()) 144 return false; 145 SequenceCommand other = (SequenceCommand) obj; 146 if (continueOnError != other.continueOnError) 147 return false; 148 if (name == null) { 149 if (other.name != null) 150 return false; 151 } else if (!name.equals(other.name)) 152 return false; 153 if (!Arrays.equals(sequence, other.sequence)) 154 return false; 155 if (sequenceComplete != other.sequenceComplete) 156 return false; 157 return true; 134 if (this == obj) return true; 135 if (obj == null || getClass() != obj.getClass()) return false; 136 if (!super.equals(obj)) return false; 137 SequenceCommand that = (SequenceCommand) obj; 138 return sequenceComplete == that.sequenceComplete && 139 continueOnError == that.continueOnError && 140 Arrays.equals(sequence, that.sequence) && 141 Objects.equals(name, that.name); 158 142 } 159 143 } -
trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java
r9243 r9371 8 8 import java.util.LinkedList; 9 9 import java.util.Map; 10 import java.util.Objects; 10 11 11 12 import javax.swing.Icon; … … 145 146 @Override 146 147 public int hashCode() { 147 final int prime = 31; 148 int result = super.hashCode(); 149 result = prime * result + ((nodes == null) ? 0 : nodes.hashCode()); 150 result = prime * result + ((oldStates == null) ? 0 : oldStates.hashCode()); 151 return result; 148 return Objects.hash(super.hashCode(), nodes, oldStates); 152 149 } 153 150 154 151 @Override 155 152 public boolean equals(Object obj) { 156 if (this == obj) 157 return true; 158 if (!super.equals(obj)) 159 return false; 160 if (getClass() != obj.getClass()) 161 return false; 162 TransformNodesCommand other = (TransformNodesCommand) obj; 163 if (nodes == null) { 164 if (other.nodes != null) 165 return false; 166 } else if (!nodes.equals(other.nodes)) 167 return false; 168 if (oldStates == null) { 169 if (other.oldStates != null) 170 return false; 171 } else if (!oldStates.equals(other.oldStates)) 172 return false; 173 return true; 153 if (this == obj) return true; 154 if (obj == null || getClass() != obj.getClass()) return false; 155 if (!super.equals(obj)) return false; 156 TransformNodesCommand that = (TransformNodesCommand) obj; 157 return Objects.equals(nodes, that.nodes) && 158 Objects.equals(oldStates, that.oldStates); 174 159 } 175 160 } -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
r8914 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import javax.swing.Icon; … … 89 90 @Override 90 91 public int hashCode() { 91 final int prime = 31; 92 int result = super.hashCode(); 93 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 94 return result; 92 return Objects.hash(super.hashCode(), conflict); 95 93 } 96 94 97 95 @Override 98 96 public boolean equals(Object obj) { 99 if (this == obj) 100 return true; 101 if (!super.equals(obj)) 102 return false; 103 if (getClass() != obj.getClass()) 104 return false; 105 ConflictAddCommand other = (ConflictAddCommand) obj; 106 if (conflict == null) { 107 if (other.conflict != null) 108 return false; 109 } else if (!conflict.equals(other.conflict)) 110 return false; 111 return true; 97 if (this == obj) return true; 98 if (obj == null || getClass() != obj.getClass()) return false; 99 if (!super.equals(obj)) return false; 100 ConflictAddCommand that = (ConflictAddCommand) obj; 101 return Objects.equals(conflict, that.conflict); 112 102 } 113 103 } -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
r8914 r9371 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import java.util.Objects; 5 7 6 8 import org.openstreetmap.josm.Main; … … 84 86 @Override 85 87 public int hashCode() { 86 final int prime = 31; 87 int result = super.hashCode(); 88 result = prime * result + ((resolvedConflicts == null) ? 0 : resolvedConflicts.hashCode()); 89 return result; 88 return Objects.hash(super.hashCode(), resolvedConflicts); 90 89 } 91 90 92 91 @Override 93 92 public boolean equals(Object obj) { 94 if (this == obj) 95 return true; 96 if (!super.equals(obj)) 97 return false; 98 if (getClass() != obj.getClass()) 99 return false; 100 ConflictResolveCommand other = (ConflictResolveCommand) obj; 101 if (resolvedConflicts == null) { 102 if (other.resolvedConflicts != null) 103 return false; 104 } else if (!resolvedConflicts.equals(other.resolvedConflicts)) 105 return false; 106 return true; 93 if (this == obj) return true; 94 if (obj == null || getClass() != obj.getClass()) return false; 95 if (!super.equals(obj)) return false; 96 ConflictResolveCommand that = (ConflictResolveCommand) obj; 97 return Objects.equals(resolvedConflicts, that.resolvedConflicts); 107 98 } 108 99 } -
trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java
r8910 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 8 9 import javax.swing.Icon; … … 76 77 @Override 77 78 public int hashCode() { 78 final int prime = 31; 79 int result = super.hashCode(); 80 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 81 result = prime * result + ((decision == null) ? 0 : decision.hashCode()); 82 return result; 79 return Objects.hash(super.hashCode(), conflict, decision); 83 80 } 84 81 85 82 @Override 86 83 public boolean equals(Object obj) { 87 if (this == obj) 88 return true; 89 if (!super.equals(obj)) 90 return false; 91 if (getClass() != obj.getClass()) 92 return false; 93 CoordinateConflictResolveCommand other = (CoordinateConflictResolveCommand) obj; 94 if (conflict == null) { 95 if (other.conflict != null) 96 return false; 97 } else if (!conflict.equals(other.conflict)) 98 return false; 99 if (decision != other.decision) 100 return false; 101 return true; 84 if (this == obj) return true; 85 if (obj == null || getClass() != obj.getClass()) return false; 86 if (!super.equals(obj)) return false; 87 CoordinateConflictResolveCommand that = (CoordinateConflictResolveCommand) obj; 88 return Objects.equals(conflict, that.conflict) && 89 decision == that.decision; 102 90 } 103 91 } -
trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java
r8910 r9371 5 5 6 6 import java.util.Collection; 7 import java.util.Objects; 7 8 import java.util.Set; 8 9 … … 91 92 @Override 92 93 public int hashCode() { 93 final int prime = 31; 94 int result = super.hashCode(); 95 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 96 result = prime * result + ((decision == null) ? 0 : decision.hashCode()); 97 return result; 94 return Objects.hash(super.hashCode(), conflict, decision); 98 95 } 99 96 100 97 @Override 101 98 public boolean equals(Object obj) { 102 if (this == obj) 103 return true; 104 if (!super.equals(obj)) 105 return false; 106 if (getClass() != obj.getClass()) 107 return false; 108 DeletedStateConflictResolveCommand other = (DeletedStateConflictResolveCommand) obj; 109 if (conflict == null) { 110 if (other.conflict != null) 111 return false; 112 } else if (!conflict.equals(other.conflict)) 113 return false; 114 if (decision != other.decision) 115 return false; 116 return true; 99 if (this == obj) return true; 100 if (obj == null || getClass() != obj.getClass()) return false; 101 if (!super.equals(obj)) return false; 102 DeletedStateConflictResolveCommand that = (DeletedStateConflictResolveCommand) obj; 103 return Objects.equals(conflict, that.conflict) && 104 decision == that.decision; 117 105 } 118 106 } -
trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java
r8910 r9371 6 6 7 7 import java.util.Collection; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 67 68 @Override 68 69 public int hashCode() { 69 final int prime = 31; 70 int result = super.hashCode(); 71 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 72 return result; 70 return Objects.hash(super.hashCode(), conflict); 73 71 } 74 72 75 73 @Override 76 74 public boolean equals(Object obj) { 77 if (this == obj) 78 return true; 79 if (!super.equals(obj)) 80 return false; 81 if (getClass() != obj.getClass()) 82 return false; 83 ModifiedConflictResolveCommand other = (ModifiedConflictResolveCommand) obj; 84 if (conflict == null) { 85 if (other.conflict != null) 86 return false; 87 } else if (!conflict.equals(other.conflict)) 88 return false; 89 return true; 75 if (this == obj) return true; 76 if (obj == null || getClass() != obj.getClass()) return false; 77 if (!super.equals(obj)) return false; 78 ModifiedConflictResolveCommand that = (ModifiedConflictResolveCommand) obj; 79 return Objects.equals(conflict, that.conflict); 90 80 } 91 81 } -
trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
r8510 r9371 6 6 import java.util.Collection; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 98 99 @Override 99 100 public int hashCode() { 100 final int prime = 31; 101 int result = super.hashCode(); 102 result = prime * result + ((mergedMembers == null) ? 0 : mergedMembers.hashCode()); 103 result = prime * result + ((my == null) ? 0 : my.hashCode()); 104 result = prime * result + ((their == null) ? 0 : their.hashCode()); 105 return result; 101 return Objects.hash(super.hashCode(), my, their, mergedMembers); 106 102 } 107 103 108 104 @Override 109 105 public boolean equals(Object obj) { 110 if (this == obj) 111 return true; 112 if (!super.equals(obj)) 113 return false; 114 if (getClass() != obj.getClass()) 115 return false; 116 RelationMemberConflictResolverCommand other = (RelationMemberConflictResolverCommand) obj; 117 if (mergedMembers == null) { 118 if (other.mergedMembers != null) 119 return false; 120 } else if (!mergedMembers.equals(other.mergedMembers)) 121 return false; 122 if (my == null) { 123 if (other.my != null) 124 return false; 125 } else if (!my.equals(other.my)) 126 return false; 127 if (their == null) { 128 if (other.their != null) 129 return false; 130 } else if (!their.equals(other.their)) 131 return false; 132 return true; 106 if (this == obj) return true; 107 if (obj == null || getClass() != obj.getClass()) return false; 108 if (!super.equals(obj)) return false; 109 RelationMemberConflictResolverCommand that = (RelationMemberConflictResolverCommand) obj; 110 return Objects.equals(my, that.my) && 111 Objects.equals(their, that.their) && 112 Objects.equals(mergedMembers, that.mergedMembers); 133 113 } 134 114 } -
trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java
r8910 r9371 6 6 import java.util.Collection; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 103 104 @Override 104 105 public int hashCode() { 105 final int prime = 31; 106 int result = super.hashCode(); 107 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 108 result = prime * result + ((mergeItems == null) ? 0 : mergeItems.hashCode()); 109 return result; 106 return Objects.hash(super.hashCode(), conflict, mergeItems); 110 107 } 111 108 112 109 @Override 113 110 public boolean equals(Object obj) { 114 if (this == obj) 115 return true; 116 if (!super.equals(obj)) 117 return false; 118 if (getClass() != obj.getClass()) 119 return false; 120 TagConflictResolveCommand other = (TagConflictResolveCommand) obj; 121 if (conflict == null) { 122 if (other.conflict != null) 123 return false; 124 } else if (!conflict.equals(other.conflict)) 125 return false; 126 if (mergeItems == null) { 127 if (other.mergeItems != null) 128 return false; 129 } else if (!mergeItems.equals(other.mergeItems)) 130 return false; 131 return true; 111 if (this == obj) return true; 112 if (obj == null || getClass() != obj.getClass()) return false; 113 if (!super.equals(obj)) return false; 114 TagConflictResolveCommand that = (TagConflictResolveCommand) obj; 115 return Objects.equals(conflict, that.conflict) && 116 Objects.equals(mergeItems, that.mergeItems); 132 117 } 133 118 } -
trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java
r8910 r9371 6 6 7 7 import java.util.Collection; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 76 77 @Override 77 78 public int hashCode() { 78 final int prime = 31; 79 int result = super.hashCode(); 80 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 81 return result; 79 return Objects.hash(super.hashCode(), conflict); 82 80 } 83 81 84 82 @Override 85 83 public boolean equals(Object obj) { 86 if (this == obj) 87 return true; 88 if (!super.equals(obj)) 89 return false; 90 if (getClass() != obj.getClass()) 91 return false; 92 VersionConflictResolveCommand other = (VersionConflictResolveCommand) obj; 93 if (conflict == null) { 94 if (other.conflict != null) 95 return false; 96 } else if (!conflict.equals(other.conflict)) 97 return false; 98 return true; 84 if (this == obj) return true; 85 if (obj == null || getClass() != obj.getClass()) return false; 86 if (!super.equals(obj)) return false; 87 VersionConflictResolveCommand that = (VersionConflictResolveCommand) obj; 88 return Objects.equals(conflict, that.conflict); 99 89 } 100 90 } -
trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java
r8910 r9371 6 6 import java.util.Collection; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import javax.swing.Icon; … … 75 76 @Override 76 77 public int hashCode() { 77 final int prime = 31; 78 int result = super.hashCode(); 79 result = prime * result + ((conflict == null) ? 0 : conflict.hashCode()); 80 result = prime * result + ((mergedNodeList == null) ? 0 : mergedNodeList.hashCode()); 81 return result; 78 return Objects.hash(super.hashCode(), conflict, mergedNodeList); 82 79 } 83 80 84 81 @Override 85 82 public boolean equals(Object obj) { 86 if (this == obj) 87 return true; 88 if (!super.equals(obj)) 89 return false; 90 if (getClass() != obj.getClass()) 91 return false; 92 WayNodesConflictResolverCommand other = (WayNodesConflictResolverCommand) obj; 93 if (conflict == null) { 94 if (other.conflict != null) 95 return false; 96 } else if (!conflict.equals(other.conflict)) 97 return false; 98 if (mergedNodeList == null) { 99 if (other.mergedNodeList != null) 100 return false; 101 } else if (!mergedNodeList.equals(other.mergedNodeList)) 102 return false; 103 return true; 83 if (this == obj) return true; 84 if (obj == null || getClass() != obj.getClass()) return false; 85 if (!super.equals(obj)) return false; 86 WayNodesConflictResolverCommand that = (WayNodesConflictResolverCommand) obj; 87 return Objects.equals(conflict, that.conflict) && 88 Objects.equals(mergedNodeList, that.mergedNodeList); 104 89 } 105 90 }
Note:
See TracChangeset
for help on using the changeset viewer.