Ticket #5467: 5467.patch
File 5467.patch, 2.1 KB (added by , 13 years ago) |
---|
-
src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
5 5 6 6 import java.awt.geom.GeneralPath; 7 7 import java.util.ArrayList; 8 import java.util.Arrays; 8 9 import java.util.Collection; 9 10 import java.util.Collections; 10 11 import java.util.List; … … 25 26 import org.openstreetmap.josm.gui.mappaint.ElemStyle; 26 27 import org.openstreetmap.josm.gui.mappaint.ElemStyles; 27 28 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 28 import org.openstreetmap.josm.gui.mappaint.xml.AreaPrototype;29 29 30 30 public class MultipolygonTest extends Test { 31 31 … … 117 117 if (styles != null && !w.isClosed()) { 118 118 for (ElemStyle s : styles.generateStyles(w, SCALE, null, false).a) { 119 119 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)))); 121 123 break; 122 124 } 123 125 } … … 215 217 } 216 218 } 217 219 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)))); 220 223 } 221 224 222 225 // For painting is used Polygon class which works with ints only. For validation we need more precision