Changeset 11452 in josm for trunk/src/org
- Timestamp:
- 2017-01-12T01:24:40+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r11402 r11452 414 414 } else 415 415 continue; 416 if (candidate Way.equals(lastWay) && candidateComingToHead)416 if (candidateComingToHead && candidateWay.equals(lastWay)) 417 417 continue; 418 418 -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r11343 r11452 252 252 list.addListSelectionListener(e -> { 253 253 final Way selected = list.getSelectedValue(); 254 if ( Main.isDisplayingMapView() && selected != null&& selected.getNodesCount() > 1) {254 if (selected != null && Main.isDisplayingMapView() && selected.getNodesCount() > 1) { 255 255 final Collection<WaySegment> segments = new ArrayList<>(selected.getNodesCount() - 1); 256 256 final Iterator<Node> it = selected.getNodes().iterator(); -
trunk/src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java
r8510 r11452 36 36 URL url = AudioPlayer.url(); 37 37 try { 38 if ( AudioPlayer.paused() && url != null) {38 if (url != null && AudioPlayer.paused()) { 39 39 AudioPlayer.play(url); 40 40 } else if (AudioPlayer.playing()) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10936 r11452 229 229 // update selection to reflect which way being modified 230 230 OsmDataLayer editLayer = getLayerManager().getEditLayer(); 231 if ( getCurrentBaseNode() != null && editLayer!= null && !editLayer.data.selectionEmpty()) {231 if (editLayer != null && getCurrentBaseNode() != null && !editLayer.data.selectionEmpty()) { 232 232 DataSet currentDataSet = editLayer.data; 233 233 Way continueFrom = getWayForNode(getCurrentBaseNode()); … … 1124 1124 1125 1125 // This happens when nothing is selected, but we still want to highlight the "target node" 1126 if (mouseOnExistingNode == null && getLayerManager().getEditDataSet().selectionEmpty() && mousePos != null) {1126 if (mouseOnExistingNode == null && mousePos != null && getLayerManager().getEditDataSet().selectionEmpty()) { 1127 1127 mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive::isSelectable); 1128 1128 } … … 1161 1161 if (Main.map.mapView == null || mousePos == null 1162 1162 // don't draw line if we don't know where from or where to 1163 || getCurrentBaseNode() == null || currentMouseEastNorth== null1163 || currentMouseEastNorth == null || getCurrentBaseNode() == null 1164 1164 // don't draw line if mouse is outside window 1165 1165 || !Main.map.mapView.getBounds().contains(mousePos)) … … 1238 1238 * Check whether a connection will be made 1239 1239 */ 1240 if ( getCurrentBaseNode() != null && !wayIsFinished) {1240 if (!wayIsFinished && getCurrentBaseNode() != null) { 1241 1241 if (alt) { 1242 1242 rv.append(' ').append(tr("Start new way from last node.")); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r11385 r11452 586 586 587 587 // Select Draw Tool if no selection has been made 588 if ( getLayerManager().getEditDataSet().selectionEmpty() && !cancelDrawMode) {588 if (!cancelDrawMode && getLayerManager().getEditDataSet().selectionEmpty()) { 589 589 Main.map.selectDrawTool(true); 590 590 updateStatusLine(); … … 639 639 @Override 640 640 public void doKeyPressed(KeyEvent e) { 641 if (! Main.isDisplayingMapView() ||642 !repeatedKeySwitchLassoOption || !getShortcut().isEvent(e))return;641 if (!repeatedKeySwitchLassoOption || !Main.isDisplayingMapView() || !getShortcut().isEvent(e)) 642 return; 643 643 if (Main.isDebugEnabled()) { 644 644 Main.debug(getClass().getName()+" consuming event "+e); -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r11446 r11452 776 776 mapCSSSearch == that.mapCSSSearch && 777 777 allElements == that.allElements && 778 Objects.equals(text, that.text)&&779 mode == that.mode;778 mode == that.mode && 779 Objects.equals(text, that.text); 780 780 } 781 781 -
trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java
r9371 r11452 86 86 if (!super.equals(obj)) return false; 87 87 CoordinateConflictResolveCommand that = (CoordinateConflictResolveCommand) obj; 88 return Objects.equals(conflict, that.conflict) && 89 decision == that.decision; 88 return decision == that.decision && Objects.equals(conflict, that.conflict); 90 89 } 91 90 } -
trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java
r11240 r11452 101 101 if (!super.equals(obj)) return false; 102 102 DeletedStateConflictResolveCommand that = (DeletedStateConflictResolveCommand) obj; 103 return Objects.equals(conflict, that.conflict) && 104 decision == that.decision; 103 return decision == that.decision && Objects.equals(conflict, that.conflict); 105 104 } 106 105 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r11443 r11452 444 444 if (Main.isPlatformWindows()) { 445 445 String appdata = System.getenv("APPDATA"); 446 if ( System.getenv("ALLUSERSPROFILE") != null && appdata!= null446 if (appdata != null && System.getenv("ALLUSERSPROFILE") != null 447 447 && appdata.lastIndexOf(File.separator) != -1) { 448 448 appdata = appdata.substring(appdata.lastIndexOf(File.separator)); … … 613 613 614 614 // Backup old preferences if there are old preferences 615 if ( prefFile.exists() && prefFile.length() > 0 && initSuccessful) {615 if (initSuccessful && prefFile.exists() && prefFile.length() > 0) { 616 616 Utils.copyFile(prefFile, backupFile); 617 617 } -
trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
r11100 r11452 225 225 public String getDistText(final double dist, final NumberFormat format, final double threshold) { 226 226 double a = dist / aValue; 227 if ( !Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false) && a > bValue / aValue)227 if (a > bValue / aValue && !Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false)) 228 228 return formatText(dist / bValue, bName, format); 229 229 else if (a < threshold) -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r11331 r11452 183 183 handleNoTileAtZoom(); 184 184 int httpStatusCode = attributes.getResponseCode(); 185 if ( !isNoTileAtZoom() && httpStatusCode >= 400) {185 if (httpStatusCode >= 400 && !isNoTileAtZoom()) { 186 186 if (attributes.getErrorMessage() == null) { 187 187 tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode)); -
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r11435 r11452 296 296 if (changesetId < 0) 297 297 throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' >= 0 expected, got {1}", "changesetId", changesetId)); 298 if ( isNew() && changesetId > 0)298 if (changesetId > 0 && isNew()) 299 299 throw new IllegalStateException(tr("Cannot assign a changesetId > 0 to a new primitive. Value of changesetId is {0}", changesetId)); 300 300 … … 380 380 @Override 381 381 public void setVisible(boolean visible) { 382 if ( isNew() && !visible)382 if (!visible && isNew()) 383 383 throw new IllegalStateException(tr("A primitive with ID = 0 cannot be invisible.")); 384 384 updateFlags(FLAG_VISIBLE, visible); -
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r11277 r11452 313 313 */ 314 314 public boolean isInWorld() { 315 return isValid() && xmin >= -180.0 && xmax <= 180.0 && ymin >= -90.0 && ymax <= 90.0;315 return xmin >= -180.0 && xmax <= 180.0 && ymin >= -90.0 && ymax <= 90.0 && isValid(); 316 316 } 317 317 -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r11385 r11452 1170 1170 */ 1171 1171 public boolean hasEqualTechnicalAttributes(OsmPrimitive other) { 1172 if (other == null) return false; 1173 1174 return isDeleted() == other.isDeleted() 1175 && isModified() == other.isModified() 1176 && timestamp == other.timestamp 1177 && version == other.version 1178 && isVisible() == other.isVisible() 1179 && Objects.equals(user, other.user) 1180 && changesetId == other.changesetId; 1172 return other != null 1173 && timestamp == other.timestamp 1174 && version == other.version 1175 && changesetId == other.changesetId 1176 && isDeleted() == other.isDeleted() 1177 && isModified() == other.isModified() 1178 && isVisible() == other.isVisible() 1179 && Objects.equals(user, other.user); 1181 1180 } 1182 1181 -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r11397 r11452 274 274 } 275 275 doAddContent(o); 276 if ( isLeaf() && content.size() > MAX_OBJECTS_PER_NODE && level < QuadTiling.NR_LEVELS) {276 if (level < QuadTiling.NR_LEVELS && isLeaf() && content.size() > MAX_OBJECTS_PER_NODE) { 277 277 doSplit(); 278 278 } -
trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java
r10216 r11452 107 107 RelationMemberData that = (RelationMemberData) obj; 108 108 return memberId == that.memberId && 109 Objects.equals(role, that.role)&&110 memberType == that.memberType;109 memberType == that.memberType && 110 Objects.equals(role, that.role); 111 111 } 112 112 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r11351 r11452 1089 1089 } else if (m.isNode()) { 1090 1090 Node n = m.getNode(); 1091 if ( "via".equals(m.getRole()) && via == null) {1091 if (via == null && "via".equals(m.getRole())) { 1092 1092 via = n; 1093 1093 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r11090 r11452 297 297 /* head only takes over control if the option is true, 298 298 the direction should be shown at all and not only because it's selected */ 299 boolean showOnlyHeadArrowOnly = showThisDirectionArrow && !ds.isSelected(w) && showHeadArrowOnly;299 boolean showOnlyHeadArrowOnly = showThisDirectionArrow && showHeadArrowOnly && !ds.isSelected(w); 300 300 Color wayColor; 301 301 -
trunk/src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java
r11385 r11452 463 463 464 464 int slash2Count = countToken("//", path); 465 if ( isOff(ALLOW_2_SLASHES) && (slash2Count > 0)) {465 if (slash2Count > 0 && isOff(ALLOW_2_SLASHES)) { 466 466 return false; 467 467 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r11129 r11452 65 65 RelMember relMember = (RelMember) obj; 66 66 return relId == relMember.relId && 67 type == relMember.type && 67 68 Objects.equals(role, relMember.role) && 68 type == relMember.type &&69 69 Objects.equals(tags, relMember.tags) && 70 70 Objects.equals(coor, relMember.coor); -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r11399 r11452 319 319 "Unexpected '='. Please only specify the key to remove!"); 320 320 check.fixCommands.add(FixCommand.fixRemove(ai.val)); 321 } else if ( "fixChangeKey".equals(ai.key) && val != null) {321 } else if (val != null && "fixChangeKey".equals(ai.key)) { 322 322 CheckParameterUtil.ensureThat(val.contains("=>"), "Separate old from new key by '=>'!"); 323 323 final String[] x = val.split("=>", 2); 324 324 check.fixCommands.add(FixCommand.fixChangeKey(Tag.removeWhiteSpaces(x[0]), Tag.removeWhiteSpaces(x[1]))); 325 } else if ( "fixDeleteObject".equals(ai.key) && val != null) {325 } else if (val != null && "fixDeleteObject".equals(ai.key)) { 326 326 CheckParameterUtil.ensureThat("this".equals(val), "fixDeleteObject must be followed by 'this'"); 327 327 check.deletion = true; 328 } else if ( "suggestAlternative".equals(ai.key) && val != null) {328 } else if (val != null && "suggestAlternative".equals(ai.key)) { 329 329 check.alternatives.add(val); 330 } else if ( "assertMatch".equals(ai.key) && val != null) {330 } else if (val != null && "assertMatch".equals(ai.key)) { 331 331 check.assertions.put(val, Boolean.TRUE); 332 } else if ( "assertNoMatch".equals(ai.key) && val != null) {332 } else if (val != null && "assertNoMatch".equals(ai.key)) { 333 333 check.assertions.put(val, Boolean.FALSE); 334 } else if ( "group".equals(ai.key) && val != null) {334 } else if (val != null && "group".equals(ai.key)) { 335 335 check.group = val; 336 336 } else { -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r11129 r11452 211 211 continue; 212 212 } 213 if ( endnodesHighway.contains(en) && !s.highway&& !s.w.concernsArea()) {213 if (!s.highway && endnodesHighway.contains(en) && !s.w.concernsArea()) { 214 214 map.put(en, s.w); 215 215 } else if (endnodes.contains(en) && !s.w.concernsArea()) { -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r11367 r11452 616 616 double den = 100 * getScale(); 617 617 double scaleMin = 0.01 * den / dm / 100; 618 if ( !Double.isInfinite(scaleMin) && newScale < scaleMin) {618 if (newScale < scaleMin && !Double.isInfinite(scaleMin)) { 619 619 newScale = scaleMin; 620 620 } -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r11386 r11452 130 130 @Override 131 131 public void mouseDragged(MouseEvent e) { 132 if ( (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK &&133 !(Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK) && iStartSelectionPoint != null) {132 if (iStartSelectionPoint != null && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK 133 && !(Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) { 134 134 iEndSelectionPoint = e.getPoint(); 135 135 iSlippyMapChooser.setSelection(iStartSelectionPoint, iEndSelectionPoint); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java
r10378 r11452 83 83 RelationMemberConflictDecision that = (RelationMemberConflictDecision) obj; 84 84 return pos == that.pos && 85 Objects.equals(relation, that.relation)&&86 Objects.equals(originalPrimitive, that.originalPrimitive) &&87 Objects.equals(role, that.role) &&88 decision == that.decision;85 decision == that.decision && 86 Objects.equals(relation, that.relation) && 87 Objects.equals(originalPrimitive, that.originalPrimitive) && 88 Objects.equals(role, that.role); 89 89 } 90 90 -
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r11357 r11452 246 246 for (int i = 0; i < n; ++i) { 247 247 final ToggleDialog dlg = allDialogs.get(i); 248 if (dlg .isDialogInDefaultView() && dlg != triggeredBy) {248 if (dlg != triggeredBy && dlg.isDialogInDefaultView()) { 249 249 final int ha = dlg.getSize().height; // current 250 250 final int h0 = ha * r / sumA; // proportional shrinking … … 261 261 for (int i = 0; i < n; ++i) { 262 262 final ToggleDialog dlg = allDialogs.get(i); 263 if (dlg .isDialogInDefaultView() && dlg != triggeredBy) {263 if (dlg != triggeredBy && dlg.isDialogInDefaultView()) { 264 264 final int ha = dlg.getHeight(); 265 265 final int h0 = ha * r / sumA; -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java
r10627 r11452 118 118 } 119 119 120 if ( Main.isDisplayingMapView() && changed) {120 if (changed && Main.isDisplayingMapView()) { 121 121 Main.map.mapView.repaint(); 122 122 Main.map.filterDialog.updateDialogHeader(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r11177 r11452 159 159 txtMappaint.append(tr("The 2 selected objects have different style caches.")); 160 160 } 161 if (sc1 .equals(sc2) && sc1 != sc2) {161 if (sc1 != sc2 && sc1.equals(sc2)) { 162 162 txtMappaint.append(tr("Warning: The 2 selected objects have equal, but not identical style caches.")); 163 163 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/MinimapDialog.java
r10784 r11452 55 55 @Override 56 56 public void zoomChanged() { 57 if ( Main.isDisplayingMapView() && !skipEvents) {57 if (!skipEvents && Main.isDisplayingMapView()) { 58 58 MapView mv = Main.map.mapView; 59 59 final Bounds currentBounds = new Bounds( -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerListTransferHandler.java
r10762 r11452 96 96 boolean isSameLayerManager = tableModel.getLayerManager() == layers.getManager(); 97 97 98 if ( support.getDropAction() == MOVE && isSameLayerManager) {98 if (isSameLayerManager && support.getDropAction() == MOVE) { 99 99 for (Layer layer : layers.getLayers()) { 100 100 boolean wasBeforeInsert = layers.getManager().getLayers().indexOf(layer) <= dropLocation; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r11386 r11452 1207 1207 * content lengths, so we have to be fuzzy.. (this is UGLY, recode if u know better) 1208 1208 */ 1209 if ( conn.getContentLength() != -1 && osize >-1 && Math.abs(conn.getContentLength() - osize) > 200) {1209 if (osize > -1 && conn.getContentLength() != -1 && Math.abs(conn.getContentLength() - osize) > 200) { 1210 1210 Main.info("{0} is a mediawiki redirect", u); 1211 1211 conn.disconnect(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
r10965 r11452 98 98 } 99 99 100 if ( !RelationSortUtils.isOneway(m) && lastWct != null) {100 if (lastWct != null && !RelationSortUtils.isOneway(m)) { 101 101 wct.direction = determineDirection(i-1, lastWct.direction, i); 102 102 wct.linkPrev = wct.direction != NONE; … … 307 307 return FORWARD; 308 308 } 309 if ( n == RelationNodeMap.lastOnewayNode(m) && reversed) {309 if (reversed && n == RelationNodeMap.lastOnewayNode(m)) { 310 310 if (RelationSortUtils.isBackward(m)) 311 311 return FORWARD; -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r11366 r11452 643 643 Collection<String> history = Main.pref.getCollection(historyKey, def); 644 644 int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0)); 645 if ( age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4))646 && history != null &&!history.isEmpty()) {645 if (history != null && age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4)) 646 && !history.isEmpty()) { 647 647 return history.iterator().next(); 648 648 } else { -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r11381 r11452 1584 1584 List<Tile> newlyMissedTiles = new LinkedList<>(); 1585 1585 for (Tile missed : missedTiles) { 1586 if ( "no-tile".equals(missed.getValue("tile-info")) && zoomOffset > 0) {1586 if (zoomOffset > 0 && "no-tile".equals(missed.getValue("tile-info"))) { 1587 1587 // Don't try to paint from higher zoom levels when tile is overzoomed 1588 1588 newlyMissedTiles.add(missed); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r11288 r11452 1071 1071 } 1072 1072 1073 if ( e.isTagged() && e.getExifCoor() == null && !tagged) {1073 if (!tagged && e.isTagged() && e.getExifCoor() == null) { 1074 1074 continue; 1075 1075 } … … 1202 1202 } 1203 1203 1204 if ( curImg.tmp.getPos() == null && prevWp != null) {1204 if (prevWp != null && curImg.tmp.getPos() == null) { 1205 1205 // The values of timeDiff are between 0 and 1, it is not seconds but a dimensionless variable 1206 1206 double timeDiff = (double) (imgTime - prevWpTime) / interval; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r10763 r11452 306 306 imageChanged = currentEntry != entry; 307 307 308 if (centerView && Main.isDisplayingMapView() && entry != null&& entry.getPos() != null) {308 if (centerView && entry != null && Main.isDisplayingMapView() && entry.getPos() != null) { 309 309 Main.map.mapView.zoomTo(entry.getPos()); 310 310 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r11451 r11452 175 175 SystemOfMeasurement som = SystemOfMeasurement.getSystemOfMeasurement(); 176 176 velocityScale.addTitle(tr("Velocity, {0}", som.speedName)); 177 if ( Main.isDisplayingMapView() && oldSoM != null && newSoM != null) {177 if (oldSoM != null && newSoM != null && Main.isDisplayingMapView()) { 178 178 Main.map.mapView.repaint(); 179 179 } … … 1167 1167 */ 1168 1168 private void checkCache() { 1169 if ((computeCacheMaxLineLengthUsed != maxLineLength) || (!neutralColor.equals(computeCacheColorUsed)) 1170 || (computeCacheColored != colored) || (computeCacheColorTracksTune != colorTracksTune) 1169 if ((computeCacheMaxLineLengthUsed != maxLineLength) 1170 || (computeCacheColored != colored) 1171 || (computeCacheColorTracksTune != colorTracksTune) 1171 1172 || (computeCacheColorDynamic != colorModeDynamic) 1172 1173 || (computeCacheHeatMapDrawColorTableIdx != heatMapDrawColorTableIdx) 1174 || (!neutralColor.equals(computeCacheColorUsed)) 1173 1175 ) { 1174 1176 computeCacheMaxLineLengthUsed = maxLineLength; -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r11366 r11452 166 166 167 167 // (a) try explicit timestamped waypoints - unless suppressed 168 if ( Main.pref.getBoolean("marker.audiofromexplicitwaypoints", true) && hasWaypoints) {168 if (hasWaypoints && Main.pref.getBoolean("marker.audiofromexplicitwaypoints", true)) { 169 169 for (WayPoint w : layer.data.waypoints) { 170 170 if (w.time > firstTime) { … … 177 177 178 178 // (b) try explicit waypoints without timestamps - unless suppressed 179 if ( Main.pref.getBoolean("marker.audiofromuntimedwaypoints", true) && hasWaypoints) {179 if (hasWaypoints && Main.pref.getBoolean("marker.audiofromuntimedwaypoints", true)) { 180 180 for (WayPoint w : layer.data.waypoints) { 181 181 if (waypoints.contains(w)) { … … 197 197 198 198 // (c) use explicitly named track points, again unless suppressed 199 if ( (Main.pref.getBoolean("marker.audiofromnamedtrackpoints", false)) && layer.data.tracks != null199 if (layer.data.tracks != null && Main.pref.getBoolean("marker.audiofromnamedtrackpoints", false) 200 200 && !layer.data.tracks.isEmpty()) { 201 201 for (GpxTrack track : layer.data.tracks) { … … 211 211 212 212 // (d) use timestamp of file as location on track 213 if ( (Main.pref.getBoolean("marker.audiofromwavtimestamps", false)) && hasTracks) {213 if (hasTracks && Main.pref.getBoolean("marker.audiofromwavtimestamps", false)) { 214 214 double lastModified = wavFile.lastModified() / 1000.0; // lastModified is in 215 215 // milliseconds -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java
r10600 r11452 282 282 if (!super.equals(obj)) return false; 283 283 BoxTextElement that = (BoxTextElement) obj; 284 return Objects.equals(text, that.text)&&285 Objects.equals(boxProvider, that.boxProvider)&&286 Objects.equals(box, that.box) &&287 hAlign == that.hAlign&&288 vAlign == that.vAlign;284 return hAlign == that.hAlign && 285 vAlign == that.vAlign && 286 Objects.equals(text, that.text) && 287 Objects.equals(boxProvider, that.boxProvider) && 288 Objects.equals(box, that.box); 289 289 } 290 290 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
r11090 r11452 160 160 return false; 161 161 final LineElement other = (LineElement) obj; 162 return Objects.equals(line, other.line)&&163 Objects.equals(color, other.color)&&164 Objects.equals(dashesLine, other.dashesLine)&&165 Objects.equals(dashesBackground, other.dashesBackground) &&166 offset == other.offset&&167 realWidth == other.realWidth&&168 wayDirectionArrows == other.wayDirectionArrows;162 return offset == other.offset && 163 realWidth == other.realWidth && 164 wayDirectionArrows == other.wayDirectionArrows && 165 Objects.equals(line, other.line) && 166 Objects.equals(color, other.color) && 167 Objects.equals(dashesLine, other.dashesLine) && 168 Objects.equals(dashesBackground, other.dashesBackground); 169 169 } 170 170 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
r11148 r11452 96 96 if (!super.equals(obj)) return false; 97 97 RepeatImageElement that = (RepeatImageElement) obj; 98 return Float.compare(that.offset, offset) == 0&&99 Float.compare(that.spacing, spacing) == 0 &&100 Float.compare(that.phase, phase) == 0 &&101 Objects.equals(pattern, that.pattern)&&102 align == that.align;98 return align == that.align && 99 Float.compare(that.offset, offset) == 0 && 100 Float.compare(that.spacing, spacing) == 0 && 101 Float.compare(that.phase, phase) == 0 && 102 Objects.equals(pattern, that.pattern); 103 103 } 104 104 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r10238 r11452 199 199 if (o == null || getClass() != o.getClass()) return false; 200 200 StyleElement that = (StyleElement) o; 201 return Float.compare(that.majorZIndex, majorZIndex) == 0&&202 Float.compare(that.zIndex, zIndex) == 0 &&203 Float.compare(that.objectZIndex, objectZIndex) == 0 &&204 isModifier == that.isModifier;201 return isModifier == that.isModifier && 202 Float.compare(that.majorZIndex, majorZIndex) == 0 && 203 Float.compare(that.zIndex, zIndex) == 0 && 204 Float.compare(that.objectZIndex, objectZIndex) == 0; 205 205 } 206 206 -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
r11384 r11452 94 94 } 95 95 final UserInputTag other = (UserInputTag) obj; 96 return Objects.equals(this.key, other.key)97 && Objects.equals(this. value, other.value)98 && this.defaultKey == other.defaultKey;96 return this.defaultKey == other.defaultKey 97 && Objects.equals(this.key, other.key) 98 && Objects.equals(this.value, other.value); 99 99 } 100 100 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java
r9665 r11452 92 92 public void addCommands(List<Tag> changedTags) { 93 93 // if the user hasn't changed anything, don't create a command. 94 if ( check.getState() == initialState && def == null) return;94 if (def == null && check.getState() == initialState) return; 95 95 96 96 // otherwise change things according to the selected value. -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java
r11017 r11452 85 85 // all items were unset (and so is default) 86 86 originalValue = lhm.get(""); 87 if ( "force".equals(use_last_as_default) && LAST_VALUES.containsKey(key) && !presetInitiallyMatches) {87 if (!presetInitiallyMatches && "force".equals(use_last_as_default) && LAST_VALUES.containsKey(key)) { 88 88 combobox.setSelectedItem(lhm.get(LAST_VALUES.get(key))); 89 89 } else { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r11381 r11452 492 492 } 493 493 494 if ( Main.pref.getBoolean("taggingpreset.sortvalues", true) && values_sort) {494 if (values_sort && Main.pref.getBoolean("taggingpreset.sortvalues", true)) { 495 495 Collections.sort(entries); 496 496 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r11017 r11452 88 88 } else if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { 89 89 // selected osm primitives are untagged or filling default values feature is enabled 90 if (! "false".equals(use_last_as_default) && LAST_VALUES.containsKey(key) && !presetInitiallyMatches) {90 if (!presetInitiallyMatches && !"false".equals(use_last_as_default) && LAST_VALUES.containsKey(key)) { 91 91 textField.setText(LAST_VALUES.get(key)); 92 92 } else { -
trunk/src/org/openstreetmap/josm/gui/widgets/JMultilineLabel.java
r9463 r11452 66 66 67 67 /** 68 * Tries to determine a suitable height for the given contents and return 69 * that dimension. 68 * Tries to determine a suitable height for the given contents and return that dimension. 70 69 */ 71 70 @Override 72 71 public Dimension getPreferredSize() { 73 // Without this check it will result in an infinite loop calling 74 // getPreferredSize. Remember the old bounds and only recalculate if 75 // the size actually changed. 76 if (this.getBounds().equals(oldbounds) && oldPreferred != null) { 72 // Without this check it will result in an infinite loop calling getPreferredSize. 73 // Remember the old bounds and only recalculate if the size actually changed. 74 if (oldPreferred != null && this.getBounds().equals(oldbounds)) { 77 75 return oldPreferred; 78 76 } -
trunk/src/org/openstreetmap/josm/io/NameFinder.java
r11016 r11452 197 197 if ("searchresults".equals(qName)) { 198 198 // do nothing 199 } else if ( "named".equals(qName) && (depth == 2)) {199 } else if (depth == 2 && "named".equals(qName)) { 200 200 currentResult = new SearchResult(); 201 201 currentResult.name = atts.getValue("name"); … … 208 208 currentResult.zoom = Integer.parseInt(atts.getValue("zoom")); 209 209 data.add(currentResult); 210 } else if ( "description".equals(qName) && (depth == 3)) {210 } else if (depth == 3 && "description".equals(qName)) { 211 211 description = new StringBuilder(); 212 } else if ( "named".equals(qName) && (depth == 4)) {212 } else if (depth == 4 && "named".equals(qName)) { 213 213 // this is a "named" place in the nearest places list. 214 214 String info = atts.getValue("info"); … … 252 252 @Override 253 253 public void endElement(String namespaceURI, String localName, String qName) throws SAXException { 254 if ( "description".equals(qName) && description != null) {254 if (description != null && "description".equals(qName)) { 255 255 currentResult.description = description.toString(); 256 256 description = null; -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r11386 r11452 291 291 break; 292 292 case MIRROR: 293 if ( "mirror".equals(qName) && mirrorEntry != null) {293 if (mirrorEntry != null && "mirror".equals(qName)) { 294 294 entry.addMirror(mirrorEntry); 295 295 mirrorEntry = null; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r11366 r11452 251 251 protected void buttonAction(int buttonIndex, ActionEvent evt) { 252 252 // if layer all layers were closed, ignore all actions 253 if ( Main.getLayerManager().getEditDataSet() != null && buttonIndex != 2) {253 if (buttonIndex != 2 && Main.getLayerManager().getEditDataSet() != null) { 254 254 TableModel tm = propertyTable.getModel(); 255 255 for (int i = 0; i < tm.getRowCount(); i++) {
Note:
See TracChangeset
for help on using the changeset viewer.