Changeset 13226 in josm


Ignore:
Timestamp:
2017-12-18T23:25:29+01:00 (5 weeks ago)
Author:
Don-vip
Message:

fix #15645 - autofix objects with invalid characters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r12846 r13226  
    332332    }
    333333
     334    private static String fixLow(String s) {
     335        return s.replaceAll("[\\x00-\\x1F]", "");
     336    }
     337
    334338    private static Set<String> getPresetValues(String key) {
    335339        Set<String> res = TaggingPresets.getPresetValues(key);
     
    437441                        .message(tr("Tag value contains character with code less than 0x20"), s, key)
    438442                        .primitives(p)
     443                        .fix(() -> new ChangePropertyCommand(p, key, fixLow(value)))
    439444                        .build());
    440445                withErrors.put(p, "ICV");
     
    444449                        .message(tr("Tag key contains character with code less than 0x20"), s, key)
    445450                        .primitives(p)
     451                        .fix(() -> new ChangePropertyKeyCommand(p, key, fixLow(key)))
    446452                        .build());
    447453                withErrors.put(p, "ICK");
Note: See TracChangeset for help on using the changeset viewer.