From 6834a402aa8c055f9dbcfa5a8de34febd93f3eaf Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 30 May 2024 18:14:00 -0500 Subject: [PATCH] CLDR-17680 fix spurious CheckConsistentCasing and CheckCoverage --- .../unicode/cldr/test/CheckConsistentCasing.java | 16 ++++++++-------- .../org/unicode/cldr/test/CheckCoverage.java | 3 ++- 2 files changed, 10 insertions(+), 9 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..7bf4fc65b7f 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,7 +131,8 @@ public CheckCLDR handleSetCldrFileToCheck( supplementalData = SupplementalDataInfo.getInstance(cldrFileToCheck.getSupplementalDirectory()); coverageLevel = CoverageLevel2.getInstance(supplementalData, localeID); - PluralInfo pluralInfo = supplementalData.getPlurals(PluralType.cardinal, localeID); + PluralInfo pluralInfo = + supplementalData.getPlurals(PluralType.cardinal, localeID, false); if (pluralInfo == supplementalData.getPlurals(PluralType.cardinal, LocaleNames.ROOT) && !SpecialLocales.isScratchLocale(localeID)) { possibleErrors.add(