Changeset 10659 in josm for trunk/src/org/openstreetmap/josm/actions
 Timestamp:
 20160727T02:48:44+02:00 (4 years ago)
 Location:
 trunk/src/org/openstreetmap/josm/actions
 Files:

 5 edited
Legend:
 Unmodified
 Added
 Removed

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(n2); … … 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;
Note: See TracChangeset
for help on using the changeset viewer.