From c1dc8c7ef6584668345cf741e51b1722d8114bc8 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 30 May 2024 19:06:25 -0500 Subject: [PATCH] CLDR-17680 fix spurious CheckConsistentCasing and CheckCoverage (#3767) --- tools/cldr-apps/js/src/views/GeneralInfo.vue | 2 +- .../unicode/cldr/test/CheckConsistentCasing.java | 16 ++++++++-------- .../org/unicode/cldr/test/CheckCoverage.java | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/cldr-apps/js/src/views/GeneralInfo.vue b/tools/cldr-apps/js/src/views/GeneralInfo.vue index a0e17a8816c..91078db2b66 100644 --- a/tools/cldr-apps/js/src/views/GeneralInfo.vue +++ b/tools/cldr-apps/js/src/views/GeneralInfo.vue @@ -11,7 +11,7 @@ Open Dashboard - + 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)