Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r9070 r9371 16 16 import java.util.List; 17 17 import java.util.Map; 18 import java.util.Objects; 18 19 import java.util.Set; 19 20 import java.util.Stack; … … 343 344 @Override 344 345 public int hashCode() { 345 final int prime = 31; 346 int result = 1; 347 result = prime * result + ((a == null) ? 0 : a.hashCode()); 348 result = prime * result + ((b == null) ? 0 : b.hashCode()); 349 return result; 346 return Objects.hash(a, b); 350 347 } 351 348 352 349 @Override 353 350 public boolean equals(Object obj) { 354 if (this == obj) 355 return true; 356 if (obj == null) 357 return false; 358 if (getClass() != obj.getClass()) 359 return false; 360 NodePair other = (NodePair) obj; 361 if (a == null) { 362 if (other.a != null) 363 return false; 364 } else if (!a.equals(other.a)) 365 return false; 366 if (b == null) { 367 if (other.b != null) 368 return false; 369 } else if (!b.equals(other.b)) 370 return false; 371 return true; 351 if (this == obj) return true; 352 if (obj == null || getClass() != obj.getClass()) return false; 353 NodePair nodePair = (NodePair) obj; 354 return Objects.equals(a, nodePair.a) && 355 Objects.equals(b, nodePair.b); 372 356 } 373 357 } -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r8895 r9371 11 11 import java.util.LinkedList; 12 12 import java.util.List; 13 import java.util.Objects; 13 14 import java.util.ServiceConfigurationError; 14 15 … … 350 351 @Override 351 352 public int hashCode() { 352 final int prime = 31; 353 int result = 1; 354 result = prime * result + ((defaultExtension == null) ? 0 : defaultExtension.hashCode()); 355 result = prime * result + ((description == null) ? 0 : description.hashCode()); 356 result = prime * result + ((extensions == null) ? 0 : extensions.hashCode()); 357 return result; 353 return Objects.hash(extensions, description, defaultExtension); 358 354 } 359 355 360 356 @Override 361 357 public boolean equals(Object obj) { 362 if (this == obj) 363 return true; 364 if (obj == null) 365 return false; 366 if (getClass() != obj.getClass()) 367 return false; 368 ExtensionFileFilter other = (ExtensionFileFilter) obj; 369 if (defaultExtension == null) { 370 if (other.defaultExtension != null) 371 return false; 372 } else if (!defaultExtension.equals(other.defaultExtension)) 373 return false; 374 if (description == null) { 375 if (other.description != null) 376 return false; 377 } else if (!description.equals(other.description)) 378 return false; 379 if (extensions == null) { 380 if (other.extensions != null) 381 return false; 382 } else if (!extensions.equals(other.extensions)) 383 return false; 384 return true; 358 if (this == obj) return true; 359 if (obj == null || getClass() != obj.getClass()) return false; 360 ExtensionFileFilter that = (ExtensionFileFilter) obj; 361 return Objects.equals(extensions, that.extensions) && 362 Objects.equals(description, that.description) && 363 Objects.equals(defaultExtension, that.defaultExtension); 385 364 } 386 365 } -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r9295 r9371 17 17 import java.util.List; 18 18 import java.util.Map; 19 import java.util.Objects; 19 20 import java.util.Set; 20 21 import java.util.TreeMap; … … 92 93 @Override 93 94 public int hashCode() { 94 return rel.hashCode();95 return Objects.hash(rel, role); 95 96 } 96 97 97 98 @Override 98 99 public boolean equals(Object other) { 99 if (!(other instanceof RelationRole)) return false; 100 RelationRole otherMember = (RelationRole) other; 101 return otherMember.role.equals(role) && otherMember.rel.equals(rel); 100 if (this == other) return true; 101 if (other == null || getClass() != other.getClass()) return false; 102 RelationRole that = (RelationRole) other; 103 return Objects.equals(rel, that.rel) && 104 Objects.equals(role, that.role); 102 105 } 103 106 } … … 120 123 @Override 121 124 public int hashCode() { 122 return way.hashCode();125 return Objects.hash(way, insideToTheRight); 123 126 } 124 127 125 128 @Override 126 129 public boolean equals(Object other) { 127 if (!(other instanceof WayInPolygon)) return false; 128 WayInPolygon otherMember = (WayInPolygon) other; 129 return otherMember.way.equals(this.way) && otherMember.insideToTheRight == this.insideToTheRight; 130 if (this == other) return true; 131 if (other == null || getClass() != other.getClass()) return false; 132 WayInPolygon that = (WayInPolygon) other; 133 return insideToTheRight == that.insideToTheRight && 134 Objects.equals(way, that.way); 130 135 } 131 136 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r9079 r9371 24 24 import java.util.List; 25 25 import java.util.Map; 26 import java.util.Objects; 26 27 import java.util.Set; 27 28 … … 677 678 @Override 678 679 public boolean equals(Object other) { 679 if ( !(other instanceof SearchSetting))680 681 SearchSetting o= (SearchSetting) other;682 return o.caseSensitive == this.caseSensitive683 && o.regexSearch == this.regexSearch684 && o.mapCSSSearch == this.mapCSSSearch685 && o.allElements == this.allElements686 && o.mode.equals(this.mode)687 && o.text.equals(this.text);680 if (this == other) return true; 681 if (other == null || getClass() != other.getClass()) return false; 682 SearchSetting that = (SearchSetting) other; 683 return caseSensitive == that.caseSensitive && 684 regexSearch == that.regexSearch && 685 mapCSSSearch == that.mapCSSSearch && 686 allElements == that.allElements && 687 Objects.equals(text, that.text) && 688 mode == that.mode; 688 689 } 689 690 690 691 @Override 691 692 public int hashCode() { 692 return text.hashCode();693 return Objects.hash(text, mode, caseSensitive, regexSearch, mapCSSSearch, allElements); 693 694 } 694 695
Note:
See TracChangeset
for help on using the changeset viewer.