Ignore:
Timestamp:
2011-05-04T22:03:53+02:00 (15 years ago)
Author:
jttt
Message:

Fix #6161 Validating a file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java

    r3698 r4073  
    1414import org.openstreetmap.josm.command.ChangeCommand;
    1515import org.openstreetmap.josm.command.Command;
     16import org.openstreetmap.josm.data.osm.Node;
    1617import org.openstreetmap.josm.data.osm.OsmPrimitive;
    17 import org.openstreetmap.josm.data.osm.Node;
    1818import org.openstreetmap.josm.data.osm.Way;
    1919import org.openstreetmap.josm.data.validation.Severity;
     
    4444    public Coastlines() {
    4545        super(tr("Coastlines."),
    46               tr("This test checks that coastlines are correct."));
     46                tr("This test checks that coastlines are correct."));
    4747    }
    4848
     
    6767            Node tail = c1.lastNode();
    6868
    69             if (head.equals(tail)) {
     69            if (c1.getNodesCount() == 0 || head.equals(tail)) {
    7070                continue;
    7171            }
     
    162162                if (highlight.size() > 0) {
    163163                    errors.add(new TestError(this, Severity.ERROR, tr("Unconnected coastline"),
    164                                              UNCONNECTED_COASTLINE, primitives, highlight));
     164                            UNCONNECTED_COASTLINE, primitives, highlight));
    165165                }
    166166            }
     
    191191
    192192                errors.add(new TestError(this, Severity.ERROR, tr("Unordered coastline"),
    193                                          UNORDERED_COASTLINE, primitives, highlight));
     193                        UNORDERED_COASTLINE, primitives, highlight));
    194194            }
    195195            else if (reversed) {
    196196                errors.add(new TestError(this, Severity.ERROR, tr("Reversed coastline"),
    197                                          REVERSED_COASTLINE, primitives));
     197                        REVERSED_COASTLINE, primitives));
    198198            }
    199199        }
Note: See TracChangeset for help on using the changeset viewer.