Skip to content

Commit

Permalink
CLDR-17680 fix spurious CheckConsistentCasing and CheckCoverage
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 committed May 30, 2024
1 parent bcbb490 commit 6834a40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6834a40

Please sign in to comment.