From 3875f8bc8f68932c68cc0a2fbdd061a7e5cb1262 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 30 May 2024 18:32:32 -0500 Subject: [PATCH] CLDR-17680 fix spurious CheckConsistentCasing and CheckCoverage warnings - CheckConsistentCasing was giving a warning for scripts that don't need casing - CheckCoverage was giving an warning when plurals were == root, rather than a warning when plurals were missing --- .../unicode/cldr/test/CheckConsistentCasing.java | 16 ++++++++-------- .../org/unicode/cldr/test/CheckCoverage.java | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java index c579b37ad46..f8a064cf6e3 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckConsistentCasing.java @@ -64,19 +64,19 @@ public CheckCLDR handleSetCldrFileToCheck( } catch (Exception e) { types = Collections.emptyMap(); } + if ((types == null || types.isEmpty()) && !SpecialLocales.isScratchLocale(locale)) { + possibleErrors.add( + new CheckStatus() + .setCause(this) + .setMainType(CheckStatus.warningType) + .setSubtype(Subtype.incorrectCasing) + .setMessage("Could not load casing info for {0}", locale)); + } } else { // no casing info - since the types Map is global, and null checks aren't done, // we are better off with an empty map here types = Collections.emptyMap(); } - if ((types == null || types.isEmpty()) && !SpecialLocales.isScratchLocale(locale)) { - possibleErrors.add( - new CheckStatus() - .setCause(this) - .setMainType(CheckStatus.warningType) - .setSubtype(Subtype.incorrectCasing) - .setMessage("Could not load casing info for {0}", locale)); - } // types may be null, avoid NPE hasCasingInfo = (types == null) ? false : types.size() > 0; return this; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java index cae7bba61a2..0e5e8ea96da 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java @@ -131,9 +131,9 @@ public CheckCLDR handleSetCldrFileToCheck( supplementalData = SupplementalDataInfo.getInstance(cldrFileToCheck.getSupplementalDirectory()); coverageLevel = CoverageLevel2.getInstance(supplementalData, localeID); - PluralInfo pluralInfo = supplementalData.getPlurals(PluralType.cardinal, localeID); - if (pluralInfo == supplementalData.getPlurals(PluralType.cardinal, LocaleNames.ROOT) - && !SpecialLocales.isScratchLocale(localeID)) { + PluralInfo pluralInfo = + supplementalData.getPlurals(PluralType.cardinal, localeID, false); + if (pluralInfo == null && !SpecialLocales.isScratchLocale(localeID)) { possibleErrors.add( new CheckStatus() .setCause(this)