--- old/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java 2013-04-11 23:17:21.000000000 -0700 +++ new/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java 2013-04-11 23:17:21.000000000 -0700 @@ -53,15 +53,16 @@ return getDisplayNameImpl(calendarType, field, value, style, locale, false); } - public String getCldrDisplayName(String calendarType, int field, int value, int style, Locale locale) { + public String getJavaTimeDisplayName(String calendarType, int field, int value, int style, Locale locale) { return getDisplayNameImpl(calendarType, field, value, style, locale, true); } - public String getDisplayNameImpl(String calendarType, int field, int value, int style, Locale locale, boolean cldr) { + public String getDisplayNameImpl(String calendarType, int field, int value, int style, Locale locale, boolean javatime) { String name = null; - String key = getResourceKey(calendarType, field, style, cldr); + String key = getResourceKey(calendarType, field, style, javatime); if (key != null) { - String[] strings = LocaleProviderAdapter.forType(type).getLocaleResources(locale).getCalendarNames(key); + LocaleResources lr = LocaleProviderAdapter.forType(type).getLocaleResources(locale); + String[] strings = javatime ? lr.getJavaTimeNames(key) : lr.getCalendarNames(key); if (strings != null && strings.length > 0) { if (field == DAY_OF_WEEK || field == YEAR) { --value; @@ -104,18 +105,19 @@ } // NOTE: This method should be used ONLY BY JSR 310 classes. - public Map getCldrDisplayNames(String calendarType, int field, int style, Locale locale) { + public Map getJavaTimeDisplayNames(String calendarType, int field, int style, Locale locale) { Map names; names = getDisplayNamesImpl(calendarType, field, style, locale, true); return names.isEmpty() ? null : names; } private Map getDisplayNamesImpl(String calendarType, int field, - int style, Locale locale, boolean cldr) { - String key = getResourceKey(calendarType, field, style, cldr); + int style, Locale locale, boolean javatime) { + String key = getResourceKey(calendarType, field, style, javatime); Map map = new TreeMap<>(LengthBasedComparator.INSTANCE); if (key != null) { - String[] strings = LocaleProviderAdapter.forType(type).getLocaleResources(locale).getCalendarNames(key); + LocaleResources lr = LocaleProviderAdapter.forType(type).getLocaleResources(locale); + String[] strings = javatime ? lr.getJavaTimeNames(key) : lr.getCalendarNames(key); if (strings != null) { if (!hasDuplicates(strings)) { if (field == YEAR) { @@ -220,7 +222,7 @@ return false; } - private String getResourceKey(String type, int field, int style, boolean cldr) { + private String getResourceKey(String type, int field, int style, boolean javatime) { int baseStyle = getBaseStyle(style); boolean isStandalone = (style != baseStyle); @@ -229,9 +231,9 @@ } boolean isNarrow = (baseStyle == NARROW_FORMAT); StringBuilder key = new StringBuilder(); - // If cldr is true, use prefix "cldr.". - if (cldr) { - key.append("cldr."); + // If javatime is true, use prefix "java.time.". + if (javatime) { + key.append("java.time."); } switch (field) { case ERA: @@ -245,7 +247,7 @@ // due to historical reasons. (JRE DateFormatSymbols.getEras returns // abbreviations while other getShort*() return abbreviations.) if (this.type == LocaleProviderAdapter.Type.JRE) { - if (cldr) { + if (javatime) { if (baseStyle == LONG) { key.append("long."); } @@ -253,7 +255,7 @@ if (baseStyle == SHORT) { key.append("short."); } - } else { // CLDR + } else { // this.type == LocaleProviderAdapter.Type.CLDR if (baseStyle == LONG) { key.append("long."); }