Changeset 14571 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r14531 r14571 567 567 } 568 568 } 569 if (minDist <= MAX_LEVENSHTEIN_DISTANCE && maxPresetValueLen > MAX_LEVENSHTEIN_DISTANCE) { 569 if (minDist <= MAX_LEVENSHTEIN_DISTANCE && maxPresetValueLen > MAX_LEVENSHTEIN_DISTANCE 570 && (harmonizedValue.length() > 3 || minDist < MAX_LEVENSHTEIN_DISTANCE)) { 570 571 if (fixVals.size() < 2) { 571 572 fixedValue = closest; … … 575 576 errors.add(TestError.builder(this, Severity.WARNING, MISSPELLED_VALUE_NO_FIX) 576 577 .message(tr("Misspelled property value"), 577 marktr("Value ''{0}'' for key ''{1}'' looks like one of {2}."), prop.getValue(), key, fixVals)578 .primitives(p)579 . build());578 marktr("Value ''{0}'' for key ''{1}'' looks like one of {2}."), 579 prop.getValue(), key, fixVals) 580 .primitives(p).build()); 580 581 withErrors.put(p, "WPV"); 581 582 continue; -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
r14517 r14571 154 154 155 155 /** 156 * Check for misspelled value. 157 * @throws IOException if any I/O error occurs 158 */ 159 @Test 160 public void testShortValNotInPreset2() throws IOException { 161 final List<TestError> errors = test(OsmUtils.createPrimitive("node shop=gas")); 162 assertEquals(1, errors.size()); 163 assertEquals("Presets do not contain property value", errors.get(0).getMessage()); 164 assertEquals("Value 'gas' for key 'shop' not in presets.", errors.get(0).getDescription()); 165 assertEquals(Severity.OTHER, errors.get(0).getSeverity()); 166 assertFalse(errors.get(0).isFixable()); 167 } 168 169 /** 156 170 * Checks that tags specifically ignored are effectively not in internal presets. 157 171 * @throws IOException if any I/O error occurs
Note:
See TracChangeset
for help on using the changeset viewer.