- Timestamp:
- 2012-12-28T18:53:13+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r5637 r5641 6 6 7 7 import java.text.MessageFormat; 8 import java.util.Arrays; 8 9 import java.util.Collection; 9 10 import java.util.HashMap; 11 import java.util.HashSet; 10 12 import java.util.LinkedList; 13 import java.util.Set; 11 14 12 15 import org.openstreetmap.josm.data.osm.Node; … … 160 163 } 161 164 } 162 if (ri != null && r.types != null) { 163 Collection<OsmPrimitive> wrongTypes = new LinkedList<OsmPrimitive>(); 164 if (!r.types.contains(PresetType.WAY)) { 165 wrongTypes.addAll(r.types.contains(PresetType.CLOSEDWAY) ? ri.openways : ri.ways); 166 } 167 if (!r.types.contains(PresetType.NODE)) { 168 wrongTypes.addAll(ri.nodes); 169 } 170 if (!r.types.contains(PresetType.RELATION)) { 171 wrongTypes.addAll(ri.relations); 165 if (ri != null) { 166 Set<OsmPrimitive> wrongTypes = new HashSet<OsmPrimitive>(); 167 if (r.types != null) { 168 if (!r.types.contains(PresetType.WAY)) { 169 wrongTypes.addAll(r.types.contains(PresetType.CLOSEDWAY) ? ri.openways : ri.ways); 170 } 171 if (!r.types.contains(PresetType.NODE)) { 172 wrongTypes.addAll(ri.nodes); 173 } 174 if (!r.types.contains(PresetType.RELATION)) { 175 wrongTypes.addAll(ri.relations); 176 } 177 } 178 if (r.memberExpression != null) { 179 for (Collection<OsmPrimitive> c : Arrays.asList(new Collection[]{ri.nodes, ri.ways, ri.relations})) { 180 for (OsmPrimitive p : c) { 181 if (!r.memberExpression.match(p)) { 182 wrongTypes.add(p); 183 } 184 } 185 } 172 186 } 173 187 if (!wrongTypes.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.