Changeset 14949 in josm


Ignore:
Timestamp:
2019-04-01T19:43:51+02:00 (9 months ago)
Author:
Don-vip
Message:

see #17546 - don't issue IPA warning for *:pronunciation

File:
1 edited

Legend:

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

    r14948 r14949  
    404404    }
    405405
    406     private static boolean containsUnusualUnicodeCharacter(String s) {
    407         return s != null && s.chars().anyMatch(c -> isUnusualUnicodeBlock(UnicodeBlock.of(c)));
    408     }
    409 
    410     private static boolean isUnusualUnicodeBlock(UnicodeBlock b) {
    411         return b == UnicodeBlock.IPA_EXTENSIONS;
     406    private static boolean containsUnusualUnicodeCharacter(String key, String value) {
     407        return value != null && value.chars().anyMatch(c -> isUnusualUnicodeBlock(key, UnicodeBlock.of(c)));
     408    }
     409
     410    private static boolean isUnusualUnicodeBlock(String key, UnicodeBlock b) {
     411        return b == UnicodeBlock.IPA_EXTENSIONS && !key.endsWith(":pronunciation");
    412412    }
    413413
     
    549549            withErrors.put(p, "ICV");
    550550        }
    551         if ((containsUnusualUnicodeCharacter(value)) && !withErrors.contains(p, "UUCV")) {
     551        if ((containsUnusualUnicodeCharacter(key, value)) && !withErrors.contains(p, "UUCV")) {
    552552            errors.add(TestError.builder(this, Severity.WARNING, UNUSUAL_UNICODE_CHAR_VALUE)
    553553                    .message(tr("Tag value contains unusual Unicode character"), s, key)
Note: See TracChangeset for help on using the changeset viewer.