Changeset 5380 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-07-29T10:18:55+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r5379 r5380 458 458 } 459 459 if (checkValues && value != null && value.length() > 0 && presetsValueData != null) { 460 final Set<String> values = presetsValueData.get(key); 461 final boolean keyInPresets = values != null; 462 final boolean tagInPresets = values != null && (values.isEmpty() || values.contains(prop.getValue())); 463 460 464 boolean ignore = false; 461 465 for (String a : ignoreDataStartsWith) { … … 474 478 } 475 479 } 480 481 if (!tagInPresets) { 482 for (IgnoreKeyPair a : ignoreDataKeyPair) { 483 if (key.equals(a.key) && value.equals(a.value)) { 484 ignore = true; 485 } 486 } 487 488 for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) { 489 if (key.equals(a.key2) && value.equals(a.value2)) { 490 ignore = true; 491 } 492 } 493 } 494 476 495 if (!ignore) { 477 String i = marktr("Key ''{0}'' not in presets."); 478 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property key"), 479 tr(i, key), MessageFormat.format(i, key), INVALID_VALUE, p) ); 480 withErrors.put(p, "UPK"); 481 } else { 482 Set<String> values = presetsValueData.get(key); 483 if (values != null && values.size() > 0 && !values.contains(prop.getValue())) { 484 ignore = false; 485 for (IgnoreKeyPair a : ignoreDataKeyPair) { 486 if (key.equals(a.key) && value.equals(a.value)) { 487 ignore = true; 488 } 489 } 490 491 for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) { 492 if (key.equals(a.key2) && value.equals(a.value2)) { 493 ignore = true; 494 } 495 } 496 497 if (!ignore) { 498 String i = marktr("Value ''{0}'' for key ''{1}'' not in presets."); 499 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property value"), 500 tr(i, prop.getValue(), key), MessageFormat.format(i, prop.getValue(), key), INVALID_VALUE, p) ); 501 withErrors.put(p, "UPV"); 502 } 496 if (!keyInPresets) { 497 String i = marktr("Key ''{0}'' not in presets."); 498 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property key"), 499 tr(i, key), MessageFormat.format(i, key), INVALID_VALUE, p) ); 500 withErrors.put(p, "UPK"); 501 } else if (!tagInPresets) { 502 String i = marktr("Value ''{0}'' for key ''{1}'' not in presets."); 503 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property value"), 504 tr(i, prop.getValue(), key), MessageFormat.format(i, prop.getValue(), key), INVALID_VALUE, p) ); 505 withErrors.put(p, "UPV"); 503 506 } 504 507 }
Note:
See TracChangeset
for help on using the changeset viewer.