Changeset 4293 in josm for trunk/src


Ignore:
Timestamp:
2011-08-08T00:07:56+02:00 (13 years ago)
Author:
stoecker
Message:

fix #5467 - patch by simon04 - The validator doesn't show the last/first node of a broken Area

File:
1 edited

Legend:

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

    r4219 r4293  
    66import java.awt.geom.GeneralPath;
    77import java.util.ArrayList;
     8import java.util.Arrays;
    89import java.util.Collection;
    910import java.util.Collections;
     
    2627import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2728import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    28 import org.openstreetmap.josm.gui.mappaint.xml.AreaPrototype;
    2929
    3030public class MultipolygonTest extends Test {
     
    118118            for (ElemStyle s : styles.generateStyles(w, SCALE, null, false).a) {
    119119                if (s instanceof AreaElemStyle) {
    120                     errors.add( new TestError(this, Severity.WARNING, tr("Area style way is not closed"), NOT_CLOSED,  w));
     120                    List<Node> nodes = w.getNodes();
     121                    errors.add(new TestError(this, Severity.WARNING, tr("Area style way is not closed"), NOT_CLOSED,
     122                            Collections.singletonList(w), Arrays.asList(nodes.get(0), nodes.get(nodes.size() - 1))));
    121123                    break;
    122124                }
     
    216218            }
    217219
    218             if (!nonClosedWays.isEmpty()) {
    219                 errors.add(new TestError(this, Severity.WARNING, tr("Multipolygon is not closed"), NON_CLOSED_WAY,  Collections.singletonList(r), nonClosedWays));
     220            for (List<Node> w : nonClosedWays) {
     221                errors.add(new TestError(this, Severity.WARNING, tr("Multipolygon is not closed"), NON_CLOSED_WAY,
     222                        w, Arrays.asList(w.get(0), w.get(w.size() - 1))));
    220223            }
    221224
Note: See TracChangeset for help on using the changeset viewer.