- Timestamp:
- 2016-02-06T20:20:54+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r9404 r9744 127 127 protected static final int MISSPELLED_VALUE = 1212; 128 128 protected static final int MISSPELLED_KEY = 1213; 129 protected static final int MULTIPLE_SPACES = 1214; 129 130 /** 1250 and up is used by tagcheck */ 130 131 … … 429 430 errors.add(new TestError(this, Severity.WARNING, tr("Property values start or end with white space"), 430 431 tr(s, key), MessageFormat.format(s, key), INVALID_SPACE, p)); 432 withErrors.put(p, "SPACE"); 433 } 434 if (checkValues && value != null && value.contains(" ") && !withErrors.contains(p, "SPACE")) { 435 errors.add(new TestError(this, Severity.WARNING, tr("Property values contain multiple white spaces"), 436 tr(s, key), MessageFormat.format(s, key), MULTIPLE_SPACES, p)); 431 437 withErrors.put(p, "SPACE"); 432 438 } … … 654 660 if (value == null || value.trim().isEmpty()) { 655 661 commands.add(new ChangePropertyCommand(p, key, null)); 656 } else if (value.startsWith(" ") || value.endsWith(" ") ) {662 } else if (value.startsWith(" ") || value.endsWith(" ") || value.contains(" ")) { 657 663 commands.add(new ChangePropertyCommand(p, key, Tag.removeWhiteSpaces(value))); 658 } else if (key.startsWith(" ") || key.endsWith(" ") ) {664 } else if (key.startsWith(" ") || key.endsWith(" ") || key.contains(" ")) { 659 665 commands.add(new ChangePropertyKeyCommand(p, key, Tag.removeWhiteSpaces(key))); 660 666 } else { … … 681 687 int code = testError.getCode(); 682 688 return code == INVALID_KEY || code == EMPTY_VALUES || code == INVALID_SPACE || 683 code == INVALID_KEY_SPACE || code == INVALID_HTML || code == MISSPELLED_VALUE; 689 code == INVALID_KEY_SPACE || code == INVALID_HTML || code == MISSPELLED_VALUE || 690 code == MULTIPLE_SPACES; 684 691 } 685 692
Note:
See TracChangeset
for help on using the changeset viewer.