Changeset 22457 in osm for applications/editors/josm/plugins/validator/src
- Timestamp:
- 2010-07-27T21:43:12+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/RelationChecker.java
r21539 r22457 9 9 import java.util.HashMap; 10 10 import java.util.LinkedList; 11 import java.util.Map; 12 13 import org.openstreetmap.josm.data.osm.Node; 11 14 12 import org.openstreetmap.josm.data.osm.Relation; 15 13 import org.openstreetmap.josm.data.osm.RelationMember; 16 import org.openstreetmap.josm.data.osm.Way;17 14 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference; 18 15 import org.openstreetmap.josm.gui.tagging.TaggingPreset; … … 114 111 { 115 112 errors.add( new TestError(this, Severity.WARNING, tr("Relation type is unknown"), 116 RELATION_UNKNOWN, n) ); 113 RELATION_UNKNOWN, n) ); 117 114 118 115 } … … 144 141 if(map.size() == 0) 145 142 errors.add( new TestError(this, Severity.ERROR, tr("Relation is empty"), 146 RELATION_EMPTY, n) ); 143 RELATION_EMPTY, n) ); 147 144 else 148 145 { … … 163 160 String s = marktr("Role {0} missing"); 164 161 errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"), 165 tr(s, keyname), MessageFormat.format(s, keyname), ROLE_MISSING, n) ); 162 tr(s, keyname), MessageFormat.format(s, keyname), ROLE_MISSING, n) ); 166 163 } 167 164 else if(vc > count) … … 169 166 String s = marktr("Number of {0} roles too low ({1})"); 170 167 errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"), 171 tr(s, keyname, count), MessageFormat.format(s, keyname, count), LOW_COUNT, n) ); 168 tr(s, keyname, count), MessageFormat.format(s, keyname, count), LOW_COUNT, n) ); 172 169 } 173 170 else … … 175 172 String s = marktr("Number of {0} roles too high ({1})"); 176 173 errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"), 177 tr(s, keyname, count), MessageFormat.format(s, keyname, count), HIGH_COUNT, n) ); 174 tr(s, keyname, count), MessageFormat.format(s, keyname, count), HIGH_COUNT, n) ); 178 175 } 179 176 } 180 177 if(ri != null && ((!r.types.contains("way") && (r.types.contains("closedway") ? ri.openways > 0 : ri.ways > 0)) 181 || (!r.types.contains("node") && ri.nodes > 0) || (!r.types.contains("relation") && ri.relations > 0))) 178 || (!r.types.contains("node") && ri.nodes > 0) || (!r.types.contains("relation") && ri.relations > 0))) 182 179 { 183 180 String s = marktr("Member for role {0} of wrong type"); 184 181 errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"), 185 tr(s, keyname), MessageFormat.format(s, keyname), WRONG_TYPE, n) ); 182 tr(s, keyname), MessageFormat.format(s, keyname), WRONG_TYPE, n) ); 186 183 } 187 184 } … … 194 191 String s = marktr("Role {0} unknown"); 195 192 errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"), 196 tr(s, key), MessageFormat.format(s, key), ROLE_UNKNOWN, n) ); 193 tr(s, key), MessageFormat.format(s, key), ROLE_UNKNOWN, n) ); 197 194 } 198 195 else … … 200 197 String s = marktr("Empty role found"); 201 198 errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"), 202 tr(s), s, ROLE_EMPTY, n) ); 199 tr(s), s, ROLE_EMPTY, n) ); 203 200 } 204 201 }
Note:
See TracChangeset
for help on using the changeset viewer.