- Timestamp:
- 2016-07-27T02:48:44+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r10628 r10659 265 265 <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 --> 266 266 <compilerarg value="-XDignore.symbol.file"/> 267 <compilerarg line="-Xmaxwarns 1000"/> 267 268 </javac> 268 269 <!-- JOSM --> … … 286 287 <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 --> 287 288 <compilerarg value="-XDignore.symbol.file"/> 289 <compilerarg line="-Xmaxwarns 1000"/> 288 290 </javac> 289 291 -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r10467 r10659 13 13 import java.util.LinkedList; 14 14 import java.util.List; 15 import java.util.Objects; 15 16 import java.util.Set; 16 17 … … 313 314 Node lastNode = null; 314 315 Way lastWay = null; 315 while ( firstNode != lastNode) {316 while (!Objects.equals(firstNode, lastNode)) { 316 317 if (lastNode == null) lastNode = firstNode; 317 318 for (Way way: ways) { 318 if ( way == lastWay) continue;319 if ( way.firstNode() == lastNode) {319 if (Objects.equals(way, lastWay)) continue; 320 if (Objects.equals(way.firstNode(), lastNode)) { 320 321 List<Node> wayNodes = way.getNodes(); 321 322 for (int i = 0; i < wayNodes.size() - 1; i++) { … … 326 327 break; 327 328 } 328 if ( way.lastNode() == lastNode) {329 if (Objects.equals(way.lastNode(), lastNode)) { 329 330 List<Node> wayNodes = way.getNodes(); 330 331 for (int i = wayNodes.size() - 1; i > 0; i--) { … … 394 395 if (way.isFirstLastNode(node)) continue; 395 396 for (Way wayOther: ways) { 396 if ( way == wayOther) continue;397 if (Objects.equals(way, wayOther)) continue; 397 398 if (node.getReferrers().contains(wayOther)) return false; 398 399 } … … 407 408 for (Way w: ways) { 408 409 if (w.isClosed()) return ways.size() == 1; 409 if ( w == currentWay) continue;410 if (Objects.equals(w, currentWay)) continue; 410 411 if (currentWay == null) { 411 412 nextWay = w; … … 414 415 break; 415 416 } 416 if ( w.firstNode() == endNode) {417 if (Objects.equals(w.firstNode(), endNode)) { 417 418 nextWay = w; 418 419 endNode = w.lastNode(); 419 420 break; 420 421 } 421 if ( w.lastNode() == endNode) {422 if (Objects.equals(w.lastNode(), endNode)) { 422 423 nextWay = w; 423 424 endNode = w.firstNode(); … … 428 429 used += 1; 429 430 currentWay = nextWay; 430 if ( endNode == startNode) return used == ways.size();431 if (Objects.equals(endNode, startNode)) return used == ways.size(); 431 432 } 432 433 } -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r10601 r10659 295 295 296 296 public boolean isSuccessorOf(NodePair other) { 297 return other.getB() == a;297 return Objects.equals(other.getB(), a); 298 298 } 299 299 300 300 public boolean isPredecessorOf(NodePair other) { 301 return b == other.getA();301 return Objects.equals(b, other.getA()); 302 302 } 303 303 … … 323 323 */ 324 324 public boolean contains(Node n) { 325 return a == n || b == n;325 return Objects.equals(a, n) || Objects.equals(b, n); 326 326 } 327 327 … … 337 337 NodePair nodePair = (NodePair) obj; 338 338 return Objects.equals(a, nodePair.a) && 339 339 Objects.equals(b, nodePair.b); 340 340 } 341 341 } -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r10467 r10659 14 14 import java.util.LinkedList; 15 15 import java.util.List; 16 import java.util.Objects; 16 17 import java.util.Set; 17 18 … … 243 244 } else { 244 245 // Simplify segment 245 if (simplifiedNodes.isEmpty() || simplifiedNodes.get(simplifiedNodes.size()-1) != fromN) {246 if (simplifiedNodes.isEmpty() || !Objects.equals(simplifiedNodes.get(simplifiedNodes.size()-1), fromN)) { 246 247 simplifiedNodes.add(fromN); 247 248 } 248 if ( fromN != toN) {249 if (!Objects.equals(fromN, toN)) { 249 250 simplifiedNodes.add(toN); 250 251 } -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r10601 r10659 18 18 import java.util.LinkedList; 19 19 import java.util.List; 20 import java.util.Objects; 20 21 import java.util.Set; 21 22 import java.util.concurrent.atomic.AtomicInteger; … … 444 445 445 446 if (wayChunks.size() < 2) { 446 if ( wayChunks.get(0).get(0) == wayChunks.get(0).get(wayChunks.get(0).size() - 1)) {447 if (Objects.equals(wayChunks.get(0).get(0), wayChunks.get(0).get(wayChunks.get(0).size() - 1))) { 447 448 new Notification( 448 449 tr("You must select two or more nodes to split a circular way.")) … … 569 570 List<RelationMember> relationMembers = r.getMembers(); 570 571 for (RelationMember rm: relationMembers) { 571 if (rm.isWay() && rm.getMember() == way) {572 if (rm.isWay() && Objects.equals(rm.getMember(), way)) { 572 573 boolean insert = true; 573 574 if ("restriction".equals(type) || "destination_sign".equals(type)) { … … 630 631 if ((ir - k >= 0) && relationMembers.get(ir - k).isWay()) { 631 632 Way w = relationMembers.get(ir - k).getWay(); 632 if ( (w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) {633 if (Objects.equals(w.lastNode(), way.firstNode()) || Objects.equals(w.firstNode(), way.firstNode())) { 633 634 backwards = Boolean.FALSE; 634 } else if ( (w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) {635 } else if (Objects.equals(w.firstNode(), way.lastNode()) || Objects.equals(w.lastNode(), way.lastNode())) { 635 636 backwards = Boolean.TRUE; 636 637 } … … 639 640 if ((ir + k < relationMembers.size()) && relationMembers.get(ir + k).isWay()) { 640 641 Way w = relationMembers.get(ir + k).getWay(); 641 if ( (w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) {642 if (Objects.equals(w.lastNode(), way.firstNode()) || Objects.equals(w.firstNode(), way.firstNode())) { 642 643 backwards = Boolean.TRUE; 643 } else if ( (w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) {644 } else if (Objects.equals(w.firstNode(), way.lastNode()) || Objects.equals(w.lastNode(), way.lastNode())) { 644 645 backwards = Boolean.FALSE; 645 646 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10467 r10659 28 28 import java.util.List; 29 29 import java.util.Map; 30 import java.util.Objects; 30 31 import java.util.Set; 31 32 … … 526 527 527 528 // User clicked last node again, finish way 528 if ( n0 == n) {529 if (Objects.equals(n0, n)) { 529 530 finishDrawing(); 530 531 return; … … 575 576 576 577 // Add new node to way 577 if ( way.getNode(way.getNodesCount() - 1) == n0) {578 if (Objects.equals(way.getNode(way.getNodesCount() - 1), n0)) { 578 579 way.addNode(n); 579 580 } else { … … 817 818 } 818 819 819 if (getCurrentBaseNode() == null || getCurrentBaseNode() == currentMouseNode)820 if (getCurrentBaseNode() == null || getCurrentBaseNode().equals(currentMouseNode)) 820 821 return; // Don't create zero length way segments. 821 822 822 823 823 double curHdg = Math.toDegrees(getCurrentBaseNode().getEastNorth() … … 904 904 private void continueWayFromNode(Way way, Node node) { 905 905 int n = way.getNodesCount(); 906 if ( node == way.firstNode()) {906 if (Objects.equals(node, way.firstNode())) { 907 907 currentBaseNode = node; 908 908 if (n > 1) previousNode = way.getNode(1); 909 } else if ( node == way.lastNode()) {909 } else if (Objects.equals(node, way.lastNode())) { 910 910 currentBaseNode = node; 911 911 if (n > 1) previousNode = way.getNode(n-2); … … 944 944 Node firstNode = w.getNode(0); 945 945 Node lastNode = w.getNode(w.getNodesCount() - 1); 946 if (( firstNode == n || lastNode == n) && (firstNode !=lastNode)) {946 if ((Objects.equals(firstNode, n) || Objects.equals(lastNode, n)) && !Objects.equals(firstNode, lastNode)) { 947 947 if (way != null) 948 948 return null; -
trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
r9371 r10659 48 48 49 49 public boolean isMatchingMy(OsmPrimitive my) { 50 return this.my == my;50 return Objects.equals(this.my, my); 51 51 } 52 52 53 53 public boolean isMatchingTheir(OsmPrimitive their) { 54 return this.their == their;54 return Objects.equals(this.their, their); 55 55 } 56 56 -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r10469 r10659 334 334 */ 335 335 public String getUniqueId(ImageryInfo info) { 336 if (info.getId() != null && layerIds.get(info.getId()) == info) {336 if (info.getId() != null && info.equals(layerIds.get(info.getId()))) { 337 337 return info.getId(); 338 338 } -
trunk/src/org/openstreetmap/josm/gui/MapMover.java
r10433 r10659 194 194 @Override 195 195 public void mouseReleased(MouseEvent e) { 196 if (e.getButton() == MouseEvent.BUTTON3 || Main.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1) {196 if (e.getButton() == MouseEvent.BUTTON3 || (Main.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1)) { 197 197 endMovement(); 198 198 } -
trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
r10611 r10659 92 92 @Override 93 93 public void paint(Graphics2D g, MapView mv, Bounds bbox) { 94 if (mousePos == null || mousePosStart == null || mousePos == mousePosStart)94 if (mousePos == null || mousePosStart == null || mousePos.equals(mousePosStart)) 95 95 return; 96 96 Color color = Utils.complement(PaintColors.getBackgroundColor()); … … 279 279 280 280 private boolean isNoSelection() { 281 return mousePos == null || mousePosStart == null || mousePos == mousePosStart;281 return mousePos == null || mousePosStart == null || mousePos.equals(mousePosStart); 282 282 } 283 283 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r10657 r10659 692 692 int i = 1; 693 693 for (RelationMember m : r.getMembers()) { 694 if ( m.getMember() == primitive) {694 if (primitive.equals(m.getMember())) { 695 695 mi.add(m, i); 696 696 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r10619 r10659 678 678 for (int i = 0; i < tagData.getRowCount(); ++i) { 679 679 if (item.getValue().equals(tagData.getValueAt(i, 0) /* sic! do not use getDataKey*/)) { 680 if (item ToSelect == item) {680 if (item.equals(itemToSelect)) { 681 681 itemToSelect = null; 682 682 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r10303 r10659 482 482 } 483 483 Color customColoringTransparent = hdopAlpha < 0 ? trkPnt.customColoring : 484 new Color( trkPnt.customColoring.getRGB() & 0x00ffffff | hdopAlpha << 24, true);484 new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (hdopAlpha << 24), true); 485 485 g.setColor(customColoringTransparent); 486 486 // hdop circles … … 494 494 if (trkPnt.customColoring != null) { 495 495 Color customColoringTransparent = largePointAlpha < 0 ? trkPnt.customColoring : 496 new Color( trkPnt.customColoring.getRGB() & 0x00ffffff | largePointAlpha << 24, true);496 new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (largePointAlpha << 24), true); 497 497 498 498 g.setColor(customColoringTransparent); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r10657 r10659 513 513 @Override 514 514 public boolean applies(Environment env) { 515 return env != null && env.getCascade(env.layer) != null && not ^ env.getCascade(env.layer).containsKey(id);515 return env != null && env.getCascade(env.layer) != null && (not ^ env.getCascade(env.layer).containsKey(id)); 516 516 } 517 517 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r10657 r10659 189 189 } 190 190 191 private abstract class AbstractFinder extends AbstractVisitor {191 private abstract static class AbstractFinder extends AbstractVisitor { 192 192 protected final Environment e; 193 193 -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r10613 r10659 27 27 import java.util.List; 28 28 import java.util.Map; 29 import java.util.Objects; 29 30 import java.util.concurrent.ConcurrentHashMap; 30 31 … … 659 660 @Override 660 661 public boolean isDataFlavorSupported(DataFlavor flavor) { 661 return flavors[0] == flavor;662 return Objects.equals(flavors[0], flavor); 662 663 } 663 664 } -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r10308 r10659 7 7 import java.io.IOException; 8 8 import java.net.URL; 9 import java.util.Objects; 9 10 10 11 import javax.sound.sampled.AudioFormat; … … 297 298 double offset = command.offset(); 298 299 speed = command.speed(); 299 if ( playingUrl != command.url() ||300 if (!Objects.equals(playingUrl, command.url()) || 300 301 stateChange != State.PAUSED || 301 302 offset != 0) { -
trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java
r10043 r10659 147 147 } 148 148 for (OsmPrimitive o: rhs.getPrimitives(root)) { 149 if (condition == null || condition.match(o) && !result.contains(o)) {149 if (condition == null || (condition.match(o) && !result.contains(o))) { 150 150 result.add(o); 151 151 }
Note:
See TracChangeset
for help on using the changeset viewer.