Changeset 16488 in josm
- Timestamp:
- 2020-05-23T21:44:48+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r16436 r16488 1000 1000 @Override 1001 1001 public synchronized int hashCode() { 1002 final int prime = 31;1003 int result = prime + super.hashCode();1004 result = prime * result + ((namespaces == null) ? 0 : namespaces.hashCode());1005 result = prime * result + ((layerPrefs == null) ? 0 : layerPrefs.hashCode());1006 result = prime * result + ((dataSources == null) ? 0 : dataSources.hashCode());1007 result = prime * result + ((privateRoutes == null) ? 0 : privateRoutes.hashCode());1008 result = prime * result + ((privateTracks == null) ? 0 : privateTracks.hashCode());1009 result = prime * result + ((privateWaypoints == null) ? 0 : privateWaypoints.hashCode());1010 return result;1002 return Objects.hash( 1003 super.hashCode(), 1004 namespaces, 1005 layerPrefs, 1006 dataSources, 1007 privateRoutes, 1008 privateTracks, 1009 privateWaypoints 1010 ); 1011 1011 } 1012 1012 -
trunk/src/org/openstreetmap/josm/data/gpx/GpxTrackSegment.java
r15496 r16488 6 6 import java.util.Collections; 7 7 import java.util.List; 8 import java.util.Objects; 8 9 9 10 import org.openstreetmap.josm.data.Bounds; … … 78 79 @Override 79 80 public int hashCode() { 80 final int prime = 31; 81 int result = prime + super.hashCode(); 82 result = prime * result + ((wayPoints == null) ? 0 : wayPoints.hashCode()); 83 return result; 81 return Objects.hash(super.hashCode(), wayPoints); 84 82 } 85 83 -
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r15760 r16488 288 288 @Override 289 289 public int hashCode() { 290 final int prime = 31; 291 int result = super.hashCode(); 292 long temp = Double.doubleToLongBits(lat); 293 result = prime * result + (int) (temp ^ (temp >>> 32)); 294 temp = Double.doubleToLongBits(lon); 295 result = prime * result + (int) (temp ^ (temp >>> 32)); 296 temp = getTimeInMillis(); 297 result = prime * result + (int) (temp ^ (temp >>> 32)); 298 return result; 290 return Objects.hash(super.hashCode(), lat, lon, getTimeInMillis()); 299 291 } 300 292 -
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r16453 r16488 422 422 @Override 423 423 public int hashCode() { 424 final int prime = 31; 425 int result = 1; 426 result = prime * result + ((lhs == null) ? 0 : lhs.hashCode()); 427 result = prime * result + ((rhs == null) ? 0 : rhs.hashCode()); 428 return result; 424 return Objects.hash(lhs, lhs); 429 425 } 430 426 … … 530 526 @Override 531 527 public int hashCode() { 532 final int prime = 31; 533 int result = 1; 534 result = prime * result + (defaultValue ? 1231 : 1237); 535 result = prime * result + ((key == null) ? 0 : key.hashCode()); 536 return result; 528 return Objects.hash(defaultValue, key); 537 529 } 538 530 … … 853 845 @Override 854 846 public int hashCode() { 855 final int prime = 31; 856 int result = 1; 857 result = prime * result + compareMode; 858 result = prime * result + ((key == null) ? 0 : key.hashCode()); 859 result = prime * result + ((referenceNumber == null) ? 0 : referenceNumber.hashCode()); 860 result = prime * result + ((referenceValue == null) ? 0 : referenceValue.hashCode()); 861 return result; 847 return Objects.hash(compareMode, key, referenceNumber, referenceValue); 862 848 } 863 849 … … 1010 996 @Override 1011 997 public int hashCode() { 1012 final int prime = 31; 1013 int result = 1; 1014 result = prime * result + ((key == null) ? 0 : key.hashCode()); 1015 result = prime * result + ((keyPattern == null) ? 0 : keyPattern.hashCode()); 1016 result = prime * result + ((mode == null) ? 0 : mode.hashCode()); 1017 result = prime * result + ((value == null) ? 0 : value.hashCode()); 1018 result = prime * result + ((valuePattern == null) ? 0 : valuePattern.hashCode()); 1019 return result; 998 return Objects.hash(key, keyPattern, mode, value, valuePattern); 1020 999 } 1021 1000 … … 1117 1096 @Override 1118 1097 public int hashCode() { 1119 final int prime = 31; 1120 int result = 1; 1121 result = prime * result + (caseSensitive ? 1231 : 1237); 1122 result = prime * result + ((search == null) ? 0 : search.hashCode()); 1123 result = prime * result + ((searchRegex == null) ? 0 : searchRegex.hashCode()); 1124 return result; 1098 return Objects.hash(caseSensitive, search, searchRegex); 1125 1099 } 1126 1100 … … 1336 1310 @Override 1337 1311 public int hashCode() { 1338 final int prime = 31; 1339 int result = 1; 1340 result = prime * result + (modulo ? 1231 : 1237); 1341 result = prime * result + nth; 1342 return result; 1312 return Objects.hash(modulo, nth); 1343 1313 } 1344 1314 … … 1392 1362 @Override 1393 1363 public int hashCode() { 1394 final int prime = 31; 1395 int result = 1; 1396 result = prime * result + (int) (max ^ (max >>> 32)); 1397 result = prime * result + (int) (min ^ (min >>> 32)); 1398 return result; 1364 return Objects.hash(max, min); 1399 1365 } 1400 1366 -
trunk/src/org/openstreetmap/josm/data/preferences/AbstractProperty.java
r14155 r16488 9 9 import org.openstreetmap.josm.tools.bugreport.BugReport; 10 10 11 import java.util.Objects; 12 11 13 /** 12 14 * Captures the common functionality of preference properties … … 29 31 @Override 30 32 public int hashCode() { 31 final int prime = 31; 32 int result = 1; 33 result = prime * result + getOuterType().hashCode(); 34 result = prime * result + ((listener == null) ? 0 : listener.hashCode()); 35 return result; 33 return Objects.hash(getOuterType(), listener); 36 34 } 37 35 … … 318 316 @Override 319 317 public int hashCode() { 320 final int prime = 31; 321 int result = 1; 322 result = prime * result + ((key == null) ? 0 : key.hashCode()); 323 result = prime * result + ((preferences == null) ? 0 : preferences.hashCode()); 324 return result; 318 return Objects.hash(key, preferences); 325 319 } 326 320 -
trunk/src/org/openstreetmap/josm/data/tagging/ac/AutoCompletionItem.java
r13173 r16488 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.tagging.ac; 3 4 import java.util.Objects; 3 5 4 6 /** … … 86 88 @Override 87 89 public int hashCode() { 88 final int prime = 31; 89 int result = 1; 90 result = prime * result 91 + ((priority == null) ? 0 : priority.hashCode()); 92 result = prime * result + ((value == null) ? 0 : value.hashCode()); 93 return result; 90 return Objects.hash(priority, value); 94 91 } 95 92 -
trunk/src/org/openstreetmap/josm/gui/download/UserQueryList.java
r14433 r16488 625 625 @Override 626 626 public int hashCode() { 627 final int prime = 31; 628 int result = 1; 629 result = prime * result + ((itemKey == null) ? 0 : itemKey.hashCode()); 630 result = prime * result + ((query == null) ? 0 : query.hashCode()); 631 return result; 627 return Objects.hash(itemKey, query); 632 628 } 633 629 -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r14625 r16488 77 77 @Override 78 78 public int hashCode() { 79 return 31 * super.hashCode() + ((thumbnail == null) ? 0 : thumbnail.hashCode());79 return Objects.hash(super.hashCode(), thumbnail); 80 80 } 81 81 -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java
r16056 r16488 5 5 import java.util.Locale; 6 6 import java.util.Map; 7 import java.util.Objects; 7 8 import java.util.concurrent.CopyOnWriteArrayList; 8 9 … … 323 324 @Override 324 325 public int hashCode() { 325 final int prime = 31; 326 int result = 1; 327 result = prime * result + (autoLoad ? 1231 : 1237); 328 result = prime * result + (autoZoom ? 1231 : 1237); 329 result = prime * result + (showErrors ? 1231 : 1237); 330 return result; 326 return Objects.hash(autoLoad, autoZoom, showErrors); 331 327 } 332 328 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaIconElement.java
r13662 r16488 72 72 @Override 73 73 public int hashCode() { 74 final int prime = 31; 75 int result = super.hashCode(); 76 result = prime * result + ((iconImage == null) ? 0 : iconImage.hashCode()); 77 result = prime * result + ((iconImageAngle == null) ? 0 : iconImageAngle.hashCode()); 78 result = prime * result + ((iconPosition == null) ? 0 : iconPosition.hashCode()); 79 return result; 74 return Objects.hash(super.hashCode(), iconImage, iconImageAngle, iconPosition); 80 75 } 81 76 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/CompletelyInsideAreaStrategy.java
r15586 r16488 5 5 import java.awt.geom.Point2D; 6 6 import java.awt.geom.Rectangle2D; 7 import java.util.Objects; 7 8 8 9 import org.openstreetmap.josm.gui.MapViewState; … … 122 123 @Override 123 124 public int hashCode() { 124 final int prime = 31; 125 int result = 1; 126 long temp; 127 temp = Double.doubleToLongBits(offsetX); 128 result = prime * result + (int) (temp ^ (temp >>> 32)); 129 temp = Double.doubleToLongBits(offsetY); 130 result = prime * result + (int) (temp ^ (temp >>> 32)); 131 return result; 125 return Objects.hash(offsetX, offsetY); 132 126 } 133 127 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/OnLineStrategy.java
r14273 r16488 354 354 @Override 355 355 public int hashCode() { 356 final int prime = 31; 357 int result = 1; 358 long temp; 359 temp = Double.doubleToLongBits(yOffset); 360 result = prime * result + (int) (temp ^ (temp >>> 32)); 361 return result; 356 return Double.hashCode(yOffset); 362 357 } 363 358 -
trunk/src/org/openstreetmap/josm/gui/util/WindowGeometry.java
r14273 r16488 14 14 import java.awt.Rectangle; 15 15 import java.awt.Window; 16 import java.util.Objects; 16 17 import java.util.regex.Matcher; 17 18 import java.util.regex.Pattern; … … 491 492 @Override 492 493 public int hashCode() { 493 final int prime = 31; 494 int result = 1; 495 result = prime * result + ((extent == null) ? 0 : extent.hashCode()); 496 result = prime * result + ((topLeft == null) ? 0 : topLeft.hashCode()); 497 return result; 494 return Objects.hash(extent, topLeft); 498 495 } 499 496 -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r16427 r16488 33 33 import java.util.Map; 34 34 import java.util.Map.Entry; 35 import java.util.Objects; 35 36 import java.util.Set; 36 37 import java.util.TreeSet; … … 222 223 @Override 223 224 public int hashCode() { 224 final int prime = 31; 225 int result = prime + ((name == null) ? 0 : name.hashCode()); 226 return prime * result + ((reason == null) ? 0 : reason.hashCode()); 225 return Objects.hash(name, reason); 227 226 } 228 227 -
trunk/src/org/openstreetmap/josm/tools/RotationAngle.java
r14654 r16488 82 82 @Override 83 83 public int hashCode() { 84 final int prime = 31; 85 int result = 1; 86 long temp = Double.doubleToLongBits(angle); 87 result = prime * result + (int) (temp ^ (temp >>> 32)); 88 return result; 84 return Double.hashCode(angle); 89 85 } 90 86 -
trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java
r16436 r16488 8 8 import java.util.Collections; 9 9 import java.util.List; 10 import java.util.Objects; 10 11 import java.util.stream.Collectors; 11 12 import java.util.stream.Stream; … … 54 55 @Override 55 56 public int hashCode() { 56 return 31 + ((condition == null) ? 0 : condition.hashCode());57 return Objects.hash(condition); 57 58 } 58 59 … … 104 105 @Override 105 106 public int hashCode() { 106 return 31 * super.hashCode() + ((childCondition == null) ? 0 : childCondition.hashCode());107 return Objects.hash(super.hashCode(), childCondition); 107 108 } 108 109 … … 167 168 @Override 168 169 public int hashCode() { 169 return 31 * super.hashCode() + ((parentCondition == null) ? 0 : parentCondition.hashCode());170 return Objects.hash(super.hashCode(), parentCondition); 170 171 } 171 172 … … 210 211 @Override 211 212 public int hashCode() { 212 final int prime = 31; 213 int result = super.hashCode(); 214 result = prime * result + ((lhs == null) ? 0 : lhs.hashCode()); 215 result = prime * result + ((rhs == null) ? 0 : rhs.hashCode()); 216 return result; 213 return Objects.hash(super.hashCode(), lhs, rhs); 217 214 } 218 215 … … 263 260 @Override 264 261 public int hashCode() { 265 final int prime = 31; 266 int result = super.hashCode(); 267 result = prime * result + ((lhs == null) ? 0 : lhs.hashCode()); 268 result = prime * result + ((rhs == null) ? 0 : rhs.hashCode()); 269 return result; 262 return Objects.hash(lhs, rhs); 270 263 } 271 264 … … 396 389 @Override 397 390 public int hashCode() { 398 final int prime = 31; 399 int result = 1; 400 result = prime * result + ((context == null) ? 0 : context.hashCode()); 401 result = prime * result + ((template == null) ? 0 : template.hashCode()); 402 return result; 391 return Objects.hash(context, template); 403 392 } 404 393 -
trunk/src/org/openstreetmap/josm/tools/template_engine/SearchExpressionCondition.java
r14093 r16488 3 3 4 4 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match; 5 6 import java.util.Objects; 5 7 6 8 /** … … 40 42 @Override 41 43 public int hashCode() { 42 final int prime = 31; 43 int result = 1; 44 result = prime * result + ((condition == null) ? 0 : condition.hashCode()); 45 result = prime * result + ((text == null) ? 0 : text.hashCode()); 46 return result; 44 return Objects.hash(condition, text); 47 45 } 48 46 -
trunk/src/org/openstreetmap/josm/tools/template_engine/StaticText.java
r14093 r16488 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.tools.template_engine; 3 4 import java.util.Objects; 3 5 4 6 /** … … 36 38 @Override 37 39 public int hashCode() { 38 return 31 + ((staticText == null) ? 0 : staticText.hashCode());40 return Objects.hash(staticText); 39 41 } 40 42 -
trunk/src/org/openstreetmap/josm/tools/template_engine/Variable.java
r14093 r16488 4 4 import java.util.Collection; 5 5 import java.util.Locale; 6 import java.util.Objects; 6 7 7 8 /** … … 83 84 @Override 84 85 public int hashCode() { 85 final int prime = 31; 86 int result = 1; 87 result = prime * result + (special ? 1231 : 1237); 88 result = prime * result + ((variableName == null) ? 0 : variableName.hashCode()); 89 return result; 86 return Objects.hash(special, variableName); 90 87 } 91 88
Note:
See TracChangeset
for help on using the changeset viewer.