Ticket #18137: 18137.2.patch

File 18137.2.patch, 1.4 KB (added by taylor.smock, 6 years ago)

Get both nodes to compare to instead of just one node, some code duplication in the checks for coordinates has occurred

  • src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java

     
    448448                        List<Node> nextNodes = new ArrayList<>();
    449449                        int pos = way.getNodes().indexOf(node);
    450450                        if (pos > 0) {
    451                             nextNodes.add(way.getNode(pos - 1));
     451                            Node temporaryNode = way.getNode(pos - 1);
     452                            if (temporaryNode != null && temporaryNode.isLatLonKnown()) {
     453                                nextNodes.add(temporaryNode);
     454                            }
    452455                        }
    453456                        if (pos + 1 < way.getNodesCount()) {
    454                             nextNodes.add(way.getNode(pos + 1));
     457                            Node temporaryNode = way.getNode(pos + 1);
     458                            if (temporaryNode != null && temporaryNode.isLatLonKnown()) {
     459                                nextNodes.add(temporaryNode);
     460                            }
    455461                        }
    456462                        for (Node next : nextNodes) {
    457463                            final boolean containsN = visited.contains(next);