Changeset 7046 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2014-05-02T01:40:37+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r7033 r7046 205 205 } 206 206 for (final Object i : getList(((Invocable) ENGINE).invokeMethod(r, "getErrors"))) { 207 errors.add(new OpeningHoursTestError( key + " - " + i.toString().trim(), Severity.ERROR, prettifiedValue));207 errors.add(new OpeningHoursTestError(getErrorMessage(key, i), Severity.ERROR, prettifiedValue)); 208 208 } 209 209 for (final Object i : getList(((Invocable) ENGINE).invokeMethod(r, "getWarnings"))) { 210 errors.add(new OpeningHoursTestError( i.toString().trim(), Severity.WARNING, prettifiedValue));210 errors.add(new OpeningHoursTestError(getErrorMessage(key, i), Severity.WARNING, prettifiedValue)); 211 211 } 212 212 if (!ignoreOtherSeverity && errors.isEmpty() && prettifiedValue != null && !value.equals(prettifiedValue)) { … … 217 217 } 218 218 return errors; 219 } 220 221 /** 222 * Translates and shortens the error/warning message. 223 */ 224 private String getErrorMessage(String key, Object o) { 225 String msg = o.toString().trim() 226 .replace("Unexpected token:", tr("Unexpected token:")) 227 .replace("Unexpected token (school holiday parser):", tr("Unexpected token (school holiday parser):")) 228 .replace("Unexpected token in number range:", tr("Unexpected token in number range:")) 229 .replace("Unexpected token in week range:", tr("Unexpected token in week range:")) 230 .replace("Unexpected token in weekday range:", tr("Unexpected token in weekday range:")) 231 .replace("Unexpected token in month range:", tr("Unexpected token in month range:")) 232 .replace("Unexpected token in year range:", tr("Unexpected token in year range:")) 233 .replace("This means that the syntax is not valid at that point or it is currently not supported.", tr("Invalid/unsupported syntax.")); 234 return key + " - " + msg; 219 235 } 220 236
Note:
See TracChangeset
for help on using the changeset viewer.