- Timestamp:
- 2011-09-18T21:07:26+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r4368 r4447 9 9 import java.util.Collection; 10 10 import java.util.Collections; 11 import java.util.LinkedList; 11 12 import java.util.List; 12 13 … … 225 226 } 226 227 228 List<Node> openNodes = new LinkedList<Node>(); 227 229 for (List<Node> w : nonClosedWays) { 228 errors.add(new TestError(this, Severity.WARNING, tr("Multipolygon is not closed"), NON_CLOSED_WAY, 229 w, Arrays.asList(w.get(0), w.get(w.size() - 1)))); 230 openNodes.add(w.get(0)); 231 openNodes.add(w.get(w.size() - 1)); 232 } 233 if (!openNodes.isEmpty()) { 234 List<OsmPrimitive> primitives = new LinkedList<OsmPrimitive>(); 235 primitives.add(r); 236 primitives.addAll(openNodes); 237 Arrays.asList(openNodes, r); 238 errors.add(new TestError(this, Severity.WARNING, tr("Multipolygon is not closed"), NON_CLOSED_WAY, 239 primitives, openNodes)); 230 240 } 231 241 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java
r4294 r4447 6 6 7 7 import java.text.MessageFormat; 8 import java.util.ArrayList; 9 import java.util.List; 8 import java.util.Arrays; 10 9 11 import org.openstreetmap.josm.data.osm.Node;12 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 11 import org.openstreetmap.josm.data.osm.OsmUtils; … … 114 112 return; 115 113 } 116 Node f = w.firstNode();117 Node l = w.lastNode();118 119 List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();120 List<OsmPrimitive> highlight = new ArrayList<OsmPrimitive>();121 primitives.add(w);122 123 // The important parts of an unclosed way are the first and124 // the last node which should be connected, therefore we highlight them125 highlight.add(f);126 highlight.add(l);127 114 128 115 errors.add(new TestError(this, Severity.WARNING, tr("Unclosed way"), 129 type, etype, mode, primitives, highlight)); 116 type, etype, mode, 117 Arrays.asList(w), 118 // The important parts of an unclosed way are the first and 119 // the last node which should be connected, therefore we highlight them 120 Arrays.asList(w.firstNode(), w.lastNode()))); 130 121 } 131 122 }
Note:
See TracChangeset
for help on using the changeset viewer.