Skip to content

Commit

Permalink
CLDR-17680 fix spurious CheckConsistentCasing and CheckCoverage warnings
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
srl295 committed May 30, 2024
1 parent bcbb490 commit 3875f8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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,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)
Expand Down

0 comments on commit 3875f8b

Please sign in to comment.