@@ -2004,12 +2004,12 @@ protected void initializeData(ULocale desiredLocale, ICUResourceBundle b, String
2004
2004
standaloneShortQuarters = arrays .get ("quarters/stand-alone/abbreviated" );
2005
2005
standaloneNarrowQuarters = arrays .get ("quarters/stand-alone/narrow" );
2006
2006
2007
- abbreviatedDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/format/abbreviated" ));
2008
- wideDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/format/wide" ));
2009
- narrowDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/format/narrow" ));
2010
- standaloneAbbreviatedDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/stand-alone/abbreviated" ));
2011
- standaloneWideDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/stand-alone/wide" ));
2012
- standaloneNarrowDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/stand-alone/narrow" ));
2007
+ abbreviatedDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/format/abbreviated" ), null );
2008
+ wideDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/format/wide" ), abbreviatedDayPeriods );
2009
+ narrowDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/format/narrow" ), abbreviatedDayPeriods );
2010
+ standaloneAbbreviatedDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/stand-alone/abbreviated" ), abbreviatedDayPeriods );
2011
+ standaloneWideDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/stand-alone/wide" ), standaloneAbbreviatedDayPeriods );
2012
+ standaloneNarrowDayPeriods = loadDayPeriodStrings (maps .get ("dayPeriod/stand-alone/narrow" ), standaloneAbbreviatedDayPeriods );
2013
2013
2014
2014
for (int i = 0 ; i < DT_MONTH_PATTERN_COUNT ; i ++) {
2015
2015
String monthPatternPath = LEAP_MONTH_PATTERNS_PATHS [i ];
@@ -2129,15 +2129,24 @@ private static final boolean arrayOfArrayEquals(Object[][] aa1, Object[][]aa2) {
2129
2129
/**
2130
2130
* Loads localized names for day periods in the requested format.
2131
2131
* @param resourceMap Contains the dayPeriod resource to load
2132
- */
2133
- private String [] loadDayPeriodStrings (Map <String , String > resourceMap ) {
2134
- String strings [] = new String [DAY_PERIOD_KEYS .length ];
2135
- if (resourceMap != null ) {
2136
- for (int i = 0 ; i < DAY_PERIOD_KEYS .length ; ++i ) {
2137
- strings [i ] = resourceMap .get (DAY_PERIOD_KEYS [i ]); // Null if string doesn't exist.
2132
+ * @param copyFrom If non-null, any values in the result that would otherwise be null are copied
2133
+ * from this array
2134
+ */
2135
+ private String [] loadDayPeriodStrings (Map <String , String > resourceMap , String [] copyFrom ) {
2136
+ if (resourceMap == null && copyFrom != null ) {
2137
+ return copyFrom ;
2138
+ } else {
2139
+ String strings [] = new String [DAY_PERIOD_KEYS .length ];
2140
+ if (resourceMap != null ) {
2141
+ for (int i = 0 ; i < DAY_PERIOD_KEYS .length ; ++i ) {
2142
+ strings [i ] = resourceMap .get (DAY_PERIOD_KEYS [i ]); // Null if string doesn't exist.
2143
+ if (strings [i ] == null && copyFrom != null ) {
2144
+ strings [i ] = copyFrom [i ];
2145
+ }
2146
+ }
2138
2147
}
2148
+ return strings ;
2139
2149
}
2140
- return strings ;
2141
2150
}
2142
2151
2143
2152
/*
0 commit comments