- Timestamp:
- 2016-07-28T01:00:46+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r10659 r10662 13 13 import java.util.LinkedList; 14 14 import java.util.List; 15 import java.util.Objects;16 15 import java.util.Set; 17 16 … … 314 313 Node lastNode = null; 315 314 Way lastWay = null; 316 while ( !Objects.equals(firstNode, lastNode)) {315 while (firstNode != lastNode) { 317 316 if (lastNode == null) lastNode = firstNode; 318 317 for (Way way: ways) { 319 if ( Objects.equals(way, lastWay)) continue;320 if ( Objects.equals(way.firstNode(), lastNode)) {318 if (way == lastWay) continue; 319 if (way.firstNode() == lastNode) { 321 320 List<Node> wayNodes = way.getNodes(); 322 321 for (int i = 0; i < wayNodes.size() - 1; i++) { … … 327 326 break; 328 327 } 329 if ( Objects.equals(way.lastNode(), lastNode)) {328 if (way.lastNode() == lastNode) { 330 329 List<Node> wayNodes = way.getNodes(); 331 330 for (int i = wayNodes.size() - 1; i > 0; i--) { … … 395 394 if (way.isFirstLastNode(node)) continue; 396 395 for (Way wayOther: ways) { 397 if ( Objects.equals(way, wayOther)) continue;396 if (way == wayOther) continue; 398 397 if (node.getReferrers().contains(wayOther)) return false; 399 398 } … … 408 407 for (Way w: ways) { 409 408 if (w.isClosed()) return ways.size() == 1; 410 if ( Objects.equals(w, currentWay)) continue;409 if (w == currentWay) continue; 411 410 if (currentWay == null) { 412 411 nextWay = w; … … 415 414 break; 416 415 } 417 if ( Objects.equals(w.firstNode(), endNode)) {416 if (w.firstNode() == endNode) { 418 417 nextWay = w; 419 418 endNode = w.lastNode(); 420 419 break; 421 420 } 422 if ( Objects.equals(w.lastNode(), endNode)) {421 if (w.lastNode() == endNode) { 423 422 nextWay = w; 424 423 endNode = w.firstNode(); … … 429 428 used += 1; 430 429 currentWay = nextWay; 431 if ( Objects.equals(endNode, startNode)) return used == ways.size();430 if (endNode == startNode) return used == ways.size(); 432 431 } 433 432 } -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r10659 r10662 295 295 296 296 public boolean isSuccessorOf(NodePair other) { 297 return Objects.equals(other.getB(), a);297 return other.getB() == a; 298 298 } 299 299 300 300 public boolean isPredecessorOf(NodePair other) { 301 return Objects.equals(b, other.getA());301 return b == other.getA(); 302 302 } 303 303 … … 323 323 */ 324 324 public boolean contains(Node n) { 325 return Objects.equals(a, n) || Objects.equals(b, n);325 return a == n || b == n; 326 326 } 327 327 -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r10659 r10662 14 14 import java.util.LinkedList; 15 15 import java.util.List; 16 import java.util.Objects;17 16 import java.util.Set; 18 17 … … 244 243 } else { 245 244 // Simplify segment 246 if (simplifiedNodes.isEmpty() || !Objects.equals(simplifiedNodes.get(simplifiedNodes.size()-1), fromN)) {245 if (simplifiedNodes.isEmpty() || simplifiedNodes.get(simplifiedNodes.size()-1) != fromN) { 247 246 simplifiedNodes.add(fromN); 248 247 } 249 if ( !Objects.equals(fromN, toN)) {248 if (fromN != toN) { 250 249 simplifiedNodes.add(toN); 251 250 } -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r10659 r10662 18 18 import java.util.LinkedList; 19 19 import java.util.List; 20 import java.util.Objects;21 20 import java.util.Set; 22 21 import java.util.concurrent.atomic.AtomicInteger; … … 445 444 446 445 if (wayChunks.size() < 2) { 447 if ( Objects.equals(wayChunks.get(0).get(0), wayChunks.get(0).get(wayChunks.get(0).size() - 1))) {446 if (wayChunks.get(0).get(0) == wayChunks.get(0).get(wayChunks.get(0).size() - 1)) { 448 447 new Notification( 449 448 tr("You must select two or more nodes to split a circular way.")) … … 570 569 List<RelationMember> relationMembers = r.getMembers(); 571 570 for (RelationMember rm: relationMembers) { 572 if (rm.isWay() && Objects.equals(rm.getMember(), way)) {571 if (rm.isWay() && rm.getMember() == way) { 573 572 boolean insert = true; 574 573 if ("restriction".equals(type) || "destination_sign".equals(type)) { … … 631 630 if ((ir - k >= 0) && relationMembers.get(ir - k).isWay()) { 632 631 Way w = relationMembers.get(ir - k).getWay(); 633 if ( Objects.equals(w.lastNode(), way.firstNode()) || Objects.equals(w.firstNode(), way.firstNode())) {632 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 634 633 backwards = Boolean.FALSE; 635 } else if ( Objects.equals(w.firstNode(), way.lastNode()) || Objects.equals(w.lastNode(), way.lastNode())) {634 } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) { 636 635 backwards = Boolean.TRUE; 637 636 } … … 640 639 if ((ir + k < relationMembers.size()) && relationMembers.get(ir + k).isWay()) { 641 640 Way w = relationMembers.get(ir + k).getWay(); 642 if ( Objects.equals(w.lastNode(), way.firstNode()) || Objects.equals(w.firstNode(), way.firstNode())) {641 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 643 642 backwards = Boolean.TRUE; 644 } else if ( Objects.equals(w.firstNode(), way.lastNode()) || Objects.equals(w.lastNode(), way.lastNode())) {643 } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) { 645 644 backwards = Boolean.FALSE; 646 645 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10659 r10662 28 28 import java.util.List; 29 29 import java.util.Map; 30 import java.util.Objects;31 30 import java.util.Set; 32 31 … … 527 526 528 527 // User clicked last node again, finish way 529 if ( Objects.equals(n0, n)) {528 if (n0 == n) { 530 529 finishDrawing(); 531 530 return; … … 576 575 577 576 // Add new node to way 578 if ( Objects.equals(way.getNode(way.getNodesCount() - 1), n0)) {577 if (way.getNode(way.getNodesCount() - 1) == n0) { 579 578 way.addNode(n); 580 579 } else { … … 818 817 } 819 818 820 if (getCurrentBaseNode() == null || getCurrentBaseNode() .equals(currentMouseNode))819 if (getCurrentBaseNode() == null || getCurrentBaseNode() == currentMouseNode) 821 820 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 ( Objects.equals(node, way.firstNode())) {906 if (node == way.firstNode()) { 907 907 currentBaseNode = node; 908 908 if (n > 1) previousNode = way.getNode(1); 909 } else if ( Objects.equals(node, way.lastNode())) {909 } else if (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 (( Objects.equals(firstNode, n) || Objects.equals(lastNode, n)) && !Objects.equals(firstNode,lastNode)) {946 if ((firstNode == n || lastNode == n) && (firstNode != lastNode)) { 947 947 if (way != null) 948 948 return null; -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r10657 r10662 1033 1033 if (ref instanceof Relation && !ref.isIncomplete() && !ref.isDeleted()) { 1034 1034 for (RelationMember m : ((Relation) ref).getMembers()) { 1035 if ( osm.equals(m.getMember())) {1035 if (m.getMember() == osm) { 1036 1036 String testRole = m.getRole(); 1037 1037 if (role.equals(testRole == null ? "" : testRole)) -
trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
r10659 r10662 48 48 49 49 public boolean isMatchingMy(OsmPrimitive my) { 50 return Objects.equals(this.my, my);50 return this.my == my; 51 51 } 52 52 53 53 public boolean isMatchingTheir(OsmPrimitive their) { 54 return Objects.equals(this.their, their);54 return this.their == their; 55 55 } 56 56 -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r10659 r10662 334 334 */ 335 335 public String getUniqueId(ImageryInfo info) { 336 if (info.getId() != null && info.equals(layerIds.get(info.getId()))) {336 if (info.getId() != null && layerIds.get(info.getId()) == info) { 337 337 return info.getId(); 338 338 } -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r10657 r10662 9 9 import java.util.List; 10 10 import java.util.Map; 11 import java.util.Objects;12 11 import java.util.Set; 13 12 … … 117 116 RelationMember originalMember = members[index]; 118 117 members[index] = member; 119 if ( !Objects.equals(originalMember.getMember(), member.getMember())) {118 if (originalMember.getMember() != member.getMember()) { 120 119 member.getMember().addReferrer(this); 121 120 member.getMember().clearCachedStyle(); -
trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java
r10656 r10662 161 161 */ 162 162 public boolean refersTo(OsmPrimitive primitive) { 163 return Objects.equals(member, primitive);163 return member == primitive; 164 164 } 165 165 -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r10656 r10662 9 9 import java.util.List; 10 10 import java.util.Map; 11 import java.util.Objects;12 11 import java.util.Set; 13 12 … … 89 88 for (int i = 0; i < count && count > 2;) { 90 89 Node n = nodes.get(i); 91 if ( Objects.equals(last, n)) {90 if (last == n) { 92 91 nodes.remove(i); 93 92 --count; … … 362 361 boolean locked = writeLock(); 363 362 try { 364 boolean closed = Objects.equals(lastNode(), n) && Objects.equals(firstNode(), n);363 boolean closed = lastNode() == n && firstNode() == n; 365 364 int i; 366 365 List<Node> copy = getNodes(); … … 371 370 if (closed && i > 2) { 372 371 copy.add(copy.get(0)); 373 } else if (i >= 2 && i <= 3 && Objects.equals(copy.get(0), copy.get(i-1))) {372 } else if (i >= 2 && i <= 3 && copy.get(0) == copy.get(i-1)) { 374 373 copy.remove(i-1); 375 374 } … … 402 401 if (closed && i > 2) { 403 402 copy.add(copy.get(0)); 404 } else if (i >= 2 && i <= 3 && Objects.equals(copy.get(0), copy.get(i-1))) {403 } else if (i >= 2 && i <= 3 && copy.get(0) == copy.get(i-1)) { 405 404 copy.remove(i-1); 406 405 } … … 495 494 496 495 Node[] nodes = this.nodes; 497 return nodes.length >= 3 && Objects.equals(nodes[nodes.length-1], nodes[0]);496 return nodes.length >= 3 && nodes[nodes.length-1] == nodes[0]; 498 497 } 499 498 … … 508 507 Node distinctNode = null; 509 508 for (int i = 1; i < nodes.length-1; i++) { 510 if (distinctNode == null && !Objects.equals(nodes[i], nodes[0])) {509 if (distinctNode == null && nodes[i] != nodes[0]) { 511 510 distinctNode = nodes[i]; 512 } else if (distinctNode != null && !Objects.equals(nodes[i], nodes[0]) && !Objects.equals(nodes[i], distinctNode)) {511 } else if (distinctNode != null && nodes[i] != nodes[0] && nodes[i] != distinctNode) { 513 512 return true; 514 513 } … … 551 550 Node[] nodes = this.nodes; 552 551 if (isIncomplete() || nodes.length == 0) return false; 553 return Objects.equals(n, nodes[0]) || Objects.equals(n, nodes[nodes.length -1]);552 return n == nodes[0] || n == nodes[nodes.length -1]; 554 553 } 555 554 … … 564 563 if (isIncomplete() || nodes.length <= 2) return false; 565 564 /* circular ways have only inner nodes, so return true for them! */ 566 if ( Objects.equals(n, nodes[0]) && Objects.equals(n, nodes[nodes.length-1])) return true;565 if (n == nodes[0] && n == nodes[nodes.length-1]) return true; 567 566 for (int i = 1; i < nodes.length - 1; ++i) { 568 if ( Objects.equals(nodes[i], n)) return true;567 if (nodes[i] == n) return true; 569 568 } 570 569 return false; -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r10656 r10662 8 8 import java.util.Date; 9 9 import java.util.List; 10 import java.util.Objects;11 10 12 11 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 138 137 */ 139 138 public boolean isClosed() { 140 return getNumNodes() >= 3 && Objects.equals(nodeIds.get(0), nodeIds.get(nodeIds.size()-1));139 return getNumNodes() >= 3 && nodeIds.get(0) == nodeIds.get(nodeIds.size()-1); 141 140 } 142 141 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java
r10656 r10662 3 3 4 4 import java.awt.Color; 5 import java.util.Objects;6 5 7 6 import org.openstreetmap.josm.Main; … … 84 83 taggedColor = PaintColors.TAGGED.get(); 85 84 connectionColor = PaintColors.CONNECTION.get(); 86 if ( !Objects.equals(taggedColor, nodeColor)) {85 if (taggedColor != nodeColor) { 87 86 taggedConnectionColor = taggedColor; 88 87 } else { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r10656 r10662 34 34 import java.util.Map; 35 35 import java.util.NoSuchElementException; 36 import java.util.Objects;37 36 import java.util.concurrent.ForkJoinPool; 38 37 import java.util.concurrent.ForkJoinTask; … … 1147 1146 /* find the "direct" nodes before the via node */ 1148 1147 Node fromNode; 1149 if ( Objects.equals(fromWay.firstNode(), via)) {1148 if (fromWay.firstNode() == via) { 1150 1149 fromNode = fromWay.getNode(1); 1151 1150 } else { … … 1442 1441 GeneralPath highlightSegs = null; 1443 1442 for (WaySegment ws : highlightWaySegments) { 1444 if ( !Objects.equals(ws.way, way)|| ws.lowerIndex < offset) {1443 if (ws.way != way || ws.lowerIndex < offset) { 1445 1444 continue; 1446 1445 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r10656 r10662 11 11 import java.util.Iterator; 12 12 import java.util.List; 13 import java.util.Objects;14 13 import java.util.Set; 15 14 … … 299 298 } 300 299 } 301 if (nodes.size() >= 3 && Objects.equals(nodes.get(0), nodes.get(nodes.size() - 1))) {300 if (nodes.size() >= 3 && nodes.get(0) == nodes.get(nodes.size() - 1)) { 302 301 poly.closePath(); 303 302 } … … 549 548 if (nodes == null) { 550 549 nl = w.getNodesCount()-1; 551 if ( Objects.equals(w.getNode(nl), c.getNode(0))) {550 if (w.getNode(nl) == c.getNode(0)) { 552 551 mode = 21; 553 } else if ( Objects.equals(w.getNode(nl), c.getNode(cl))) {552 } else if (w.getNode(nl) == c.getNode(cl)) { 554 553 mode = 22; 555 } else if ( Objects.equals(w.getNode(0), c.getNode(0))) {554 } else if (w.getNode(0) == c.getNode(0)) { 556 555 mode = 11; 557 } else if ( Objects.equals(w.getNode(0), c.getNode(cl))) {556 } else if (w.getNode(0) == c.getNode(cl)) { 558 557 mode = 12; 559 558 } 560 559 } else { 561 560 nl = nodes.size()-1; 562 if ( Objects.equals(nodes.get(nl), c.getNode(0))) {561 if (nodes.get(nl) == c.getNode(0)) { 563 562 mode = 21; 564 } else if ( Objects.equals(nodes.get(0), c.getNode(cl))) {563 } else if (nodes.get(0) == c.getNode(cl)) { 565 564 mode = 12; 566 } else if ( Objects.equals(nodes.get(0), c.getNode(0))) {565 } else if (nodes.get(0) == c.getNode(0)) { 567 566 mode = 11; 568 } else if ( Objects.equals(nodes.get(nl), c.getNode(cl))) {567 } else if (nodes.get(nl) == c.getNode(cl)) { 569 568 mode = 22; 570 569 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r10659 r10662 692 692 int i = 1; 693 693 for (RelationMember m : r.getMembers()) { 694 if ( primitive.equals(m.getMember())) {694 if (m.getMember() == primitive) { 695 695 mi.add(m, i); 696 696 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r10659 r10662 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 .equals(itemToSelect)) {680 if (itemToSelect == item) { 681 681 itemToSelect = null; 682 682 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r10659 r10662 27 27 import java.util.List; 28 28 import java.util.Map; 29 import java.util.Objects;30 29 import java.util.concurrent.ConcurrentHashMap; 31 30 … … 660 659 @Override 661 660 public boolean isDataFlavorSupported(DataFlavor flavor) { 662 return Objects.equals(flavors[0], flavor);661 return flavors[0] == flavor; 663 662 } 664 663 } -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r10659 r10662 7 7 import java.io.IOException; 8 8 import java.net.URL; 9 import java.util.Objects;10 9 11 10 import javax.sound.sampled.AudioFormat; … … 298 297 double offset = command.offset(); 299 298 speed = command.speed(); 300 if ( !Objects.equals(playingUrl, command.url()) ||299 if (playingUrl != command.url() || 301 300 stateChange != State.PAUSED || 302 301 offset != 0) { -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r10658 r10662 15 15 import java.util.LinkedHashSet; 16 16 import java.util.List; 17 import java.util.Objects;18 17 import java.util.Set; 19 18 … … 116 115 int commonCount = 0; 117 116 //test if we have common nodes to add. 118 if ( Objects.equals(seg1Node1, seg2Node1) || Objects.equals(seg1Node1, seg2Node2)) {117 if (seg1Node1 == seg2Node1 || seg1Node1 == seg2Node2) { 119 118 commonCount++; 120 119 … … 128 127 } 129 128 130 if ( Objects.equals(seg1Node2, seg2Node1) || Objects.equals(seg1Node2, seg2Node2)) {129 if (seg1Node2 == seg2Node1 || seg1Node2 == seg2Node2) { 131 130 commonCount++; 132 131 … … 190 189 intersectionNodes.add(intNode); 191 190 192 if ( Objects.equals(intNode, newNode)) {191 if (intNode == newNode) { 193 192 cmds.add(new AddCommand(intNode)); 194 193 } … … 703 702 public static boolean isClockwise(List<Node> nodes) { 704 703 int nodesCount = nodes.size(); 705 if (nodesCount < 3 || !Objects.equals(nodes.get(0), nodes.get(nodesCount - 1))) {704 if (nodesCount < 3 || nodes.get(0) != nodes.get(nodesCount - 1)) { 706 705 throw new IllegalArgumentException("Way must be closed to check orientation."); 707 706 } … … 992 991 double perimeter = 0; 993 992 if (!nodes.isEmpty()) { 994 boolean closed = Objects.equals(nodes.get(0), nodes.get(nodes.size() - 1));993 boolean closed = nodes.get(0) == nodes.get(nodes.size() - 1); 995 994 int numSegments = closed ? nodes.size() - 1 : nodes.size(); 996 995 EastNorth p1 = projection == null ? nodes.get(0).getEastNorth() : projection.latlon2eastNorth(nodes.get(0).getCoor());
Note:
See TracChangeset
for help on using the changeset viewer.