Changeset 10656 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-07-27T01:09:02+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r10627 r10656 15 15 import java.util.LinkedHashSet; 16 16 import java.util.List; 17 import java.util.Objects; 17 18 import java.util.Set; 18 19 … … 115 116 int commonCount = 0; 116 117 //test if we have common nodes to add. 117 if ( seg1Node1 == seg2Node1 || seg1Node1 == seg2Node2) {118 if (Objects.equals(seg1Node1, seg2Node1) || Objects.equals(seg1Node1, seg2Node2)) { 118 119 commonCount++; 119 120 … … 127 128 } 128 129 129 if ( seg1Node2 == seg2Node1 || seg1Node2 == seg2Node2) {130 if (Objects.equals(seg1Node2, seg2Node1) || Objects.equals(seg1Node2, seg2Node2)) { 130 131 commonCount++; 131 132 … … 189 190 intersectionNodes.add(intNode); 190 191 191 if ( intNode == newNode) {192 if (Objects.equals(intNode, newNode)) { 192 193 cmds.add(new AddCommand(intNode)); 193 194 } … … 702 703 public static boolean isClockwise(List<Node> nodes) { 703 704 int nodesCount = nodes.size(); 704 if (nodesCount < 3 || nodes.get(0) != nodes.get(nodesCount - 1)) {705 if (nodesCount < 3 || !Objects.equals(nodes.get(0), nodes.get(nodesCount - 1))) { 705 706 throw new IllegalArgumentException("Way must be closed to check orientation."); 706 707 } … … 990 991 double perimeter = 0; 991 992 if (!nodes.isEmpty()) { 992 boolean closed = nodes.get(0) == nodes.get(nodes.size() - 1);993 boolean closed = Objects.equals(nodes.get(0), nodes.get(nodes.size() - 1)); 993 994 int numSegments = closed ? nodes.size() - 1 : nodes.size(); 994 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.