< prev index next >

make/jdk/src/classes/build/tools/cldrconverter/Bundle.java

Print this page
rev 58376 : [mq]: 8240626

*** 284,294 **** handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "abbreviated.AmPmMarkers"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNames"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterAbbreviations"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNarrows"); ! adjustEraNames(myMap, calendarType); handleDateTimeFormatPatterns(TIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "TimePatterns"); handleDateTimeFormatPatterns(DATE_PATTERN_KEYS, myMap, parentsMap, calendarType, "DatePatterns"); handleDateTimeFormatPatterns(DATETIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "DateTimePatterns"); } --- 284,294 ---- handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "abbreviated.AmPmMarkers"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNames"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterAbbreviations"); handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNarrows"); ! adjustEraNames(myMap, parentsMap, calendarType); handleDateTimeFormatPatterns(TIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "TimePatterns"); handleDateTimeFormatPatterns(DATE_PATTERN_KEYS, myMap, parentsMap, calendarType, "DatePatterns"); handleDateTimeFormatPatterns(DATETIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "DateTimePatterns"); }
*** 408,419 **** } } } /** ! * Fills in any empty elements with its parent element. Returns true if the resulting array is ! * identical to its parent array. * * @param parents * @param key * @param value * @return true if the resulting array is identical to its parent array. --- 408,420 ---- } } } /** ! * Fills in any empty elements with its parent element, falling back to ! * aliased one if parent element is not found. Returns true if the resulting ! * array is identical to its parent array. * * @param parents * @param key * @param value * @return true if the resulting array is identical to its parent array.
*** 421,431 **** private boolean fillInElements(Map<String, Object> parents, String key, Object value) { if (parents == null) { return false; } if (value instanceof String[]) { ! Object pvalue = parents.get(key); if (pvalue != null && pvalue instanceof String[]) { String[] strings = (String[]) value; String[] pstrings = (String[]) pvalue; for (int i = 0; i < strings.length; i++) { if (strings[i] == null || strings[i].length() == 0) { --- 422,432 ---- private boolean fillInElements(Map<String, Object> parents, String key, Object value) { if (parents == null) { return false; } if (value instanceof String[]) { ! Object pvalue = parents.getOrDefault(key, parents.get(CLDRConverter.aliases.get(key))); if (pvalue != null && pvalue instanceof String[]) { String[] strings = (String[]) value; String[] pstrings = (String[]) pvalue; for (int i = 0; i < strings.length; i++) { if (strings[i] == null || strings[i].length() == 0) {
*** 440,457 **** /* * Adjusts String[] for era names because JRE's Calendars use different * ERA value indexes in the Buddhist, Japanese Imperial, and Islamic calendars. */ ! private void adjustEraNames(Map<String, Object> map, CalendarType type) { String[][] eraNames = new String[ERA_KEYS.length][]; String[] realKeys = new String[ERA_KEYS.length]; int index = 0; for (String key : ERA_KEYS) { String realKey = type.keyElementName() + key; String[] value = (String[]) map.get(realKey); if (value != null) { switch (type) { case GREGORIAN: break; case JAPANESE: --- 441,461 ---- /* * Adjusts String[] for era names because JRE's Calendars use different * ERA value indexes in the Buddhist, Japanese Imperial, and Islamic calendars. */ ! private void adjustEraNames(Map<String, Object> map, Map<String, Object> pMap, CalendarType type) { String[][] eraNames = new String[ERA_KEYS.length][]; String[] realKeys = new String[ERA_KEYS.length]; int index = 0; for (String key : ERA_KEYS) { String realKey = type.keyElementName() + key; String[] value = (String[]) map.get(realKey); if (value != null) { + // first fill in missing elements from parents map. + fillInElements(pMap, realKey, value); + switch (type) { case GREGORIAN: break; case JAPANESE:
< prev index next >