4242import org .unicode .cldr .util .CLDRInfo .PathValueInfo ;
4343import org .unicode .cldr .util .CLDRInfo .UserInfo ;
4444import org .unicode .cldr .util .CLDRLocale ;
45+ import org .unicode .cldr .util .CldrUtility ;
4546import org .unicode .cldr .util .Counter ;
4647import org .unicode .cldr .util .DayPeriodInfo ;
4748import org .unicode .cldr .util .DayPeriodInfo .DayPeriod ;
5051import org .unicode .cldr .util .GrammarInfo ;
5152import org .unicode .cldr .util .LanguageTagParser ;
5253import org .unicode .cldr .util .Level ;
54+ import org .unicode .cldr .util .NameType ;
5355import org .unicode .cldr .util .Organization ;
5456import org .unicode .cldr .util .Pair ;
5557import org .unicode .cldr .util .PathHeader ;
@@ -476,8 +478,10 @@ public void TestAllLocales() {
476478 LanguageTagParser ltp = new LanguageTagParser ();
477479 Set <String > locales = new HashSet <>();
478480 for (String locale : getInclusion () <= 5 ? eightPointLocales : factory .getAvailable ()) {
481+ checkNullWithInheritanceMark (locale );
482+
479483 /*
480- * Only test locales without regions. E.g., test "pt", skip "pt_PT"
484+ * For checkLocale, only test locales without regions. E.g., test "pt", skip "pt_PT"
481485 */
482486 if (ltp .set (locale ).getRegion ().isEmpty ()) {
483487 locales .add (locale );
@@ -491,6 +495,28 @@ public void TestAllLocales() {
491495 logln ("Count:\t " + locales .size ());
492496 }
493497
498+ private void checkNullWithInheritanceMark (String locale ) {
499+ CLDRFile resolved = cldrFactory .make (locale , true );
500+ CLDRFile unresolved = resolved .getUnresolved ();
501+ for (String path : unresolved .fullIterable ()) {
502+ String value = unresolved .getStringValue (path );
503+ if (CldrUtility .INHERITANCE_MARKER .equals (value )) {
504+ switch (NameType .fromPath (path )) {
505+ case LANGUAGE :
506+ case SCRIPT :
507+ case TERRITORY :
508+ case VARIANT :
509+ assertNotNull (locale + " " + path , resolved .getStringValue (path ));
510+ break ;
511+ default :
512+ if (!logKnownIssue ("CLDR-18294" , "Null with inheritance mark" )) {
513+ errln ("Null with inheritance mark:\t " + locale + "\t " + path );
514+ }
515+ }
516+ }
517+ }
518+ }
519+
494520 public void TestA () {
495521 CheckCLDR test = CheckCLDR .getCheckAll (factory , INDIVIDUAL_TESTS );
496522 CheckCLDR .setDisplayInformation (english );
0 commit comments