src/share/classes/java/time/format/DateTimeTextProvider.java

Print this page

        

@@ -193,11 +193,11 @@
             fieldIndex = Calendar.AM_PM;
             fieldValue = (int) value;
         } else {
             return null;
         }
-        return CalendarDataUtility.retrieveCldrFieldValueName(
+        return CalendarDataUtility.retrieveJavaTimeFieldValueName(
                 chrono.getCalendarType(), fieldIndex, fieldValue, style.toCalendarStyle(), locale);
     }
 
     /**
      * Gets an iterator of text to field for the specified field, locale and style

@@ -264,11 +264,11 @@
         default:
             return null;
         }
 
         int calendarStyle = (style == null) ? Calendar.ALL_STYLES : style.toCalendarStyle();
-        Map<String, Integer> map = CalendarDataUtility.retrieveCldrFieldValueNames(
+        Map<String, Integer> map = CalendarDataUtility.retrieveJavaTimeFieldValueNames(
                 chrono.getCalendarType(), fieldIndex, calendarStyle, locale);
         if (map == null) {
             return null;
         }
         List<Entry<String, Long>> list = new ArrayList<>(map.size());

@@ -330,11 +330,11 @@
             for (TextStyle textStyle : TextStyle.values()) {
                 if (textStyle.isStandalone()) {
                     // Stand-alone isn't applicable to era names.
                     continue;
                 }
-                Map<String, Integer> displayNames = CalendarDataUtility.retrieveCldrFieldValueNames(
+                Map<String, Integer> displayNames = CalendarDataUtility.retrieveJavaTimeFieldValueNames(
                         "gregory", Calendar.ERA, textStyle.toCalendarStyle(), locale);
                 if (displayNames != null) {
                     Map<Long, String> map = new HashMap<>();
                     for (Entry<String, Integer> entry : displayNames.entrySet()) {
                         map.put((long) entry.getValue(), entry.getKey());

@@ -347,11 +347,11 @@
             return new LocaleStore(styleMap);
         }
 
         if (field == MONTH_OF_YEAR) {
             for (TextStyle textStyle : TextStyle.values()) {
-                Map<String, Integer> displayNames = CalendarDataUtility.retrieveCldrFieldValueNames(
+                Map<String, Integer> displayNames = CalendarDataUtility.retrieveJavaTimeFieldValueNames(
                         "gregory", Calendar.MONTH, textStyle.toCalendarStyle(), locale);
                 Map<Long, String> map = new HashMap<>();
                 if (displayNames != null) {
                     for (Entry<String, Integer> entry : displayNames.entrySet()) {
                         map.put((long) (entry.getValue() + 1), entry.getKey());

@@ -360,11 +360,11 @@
                 } else {
                     // Narrow names may have duplicated names, such as "J" for January, Jun, July.
                     // Get names one by one in that case.
                     for (int month = Calendar.JANUARY; month <= Calendar.DECEMBER; month++) {
                         String name;
-                        name = CalendarDataUtility.retrieveCldrFieldValueName(
+                        name = CalendarDataUtility.retrieveJavaTimeFieldValueName(
                                 "gregory", Calendar.MONTH, month, textStyle.toCalendarStyle(), locale);
                         if (name == null) {
                             break;
                         }
                         map.put((long) (month + 1), name);

@@ -377,11 +377,11 @@
             return new LocaleStore(styleMap);
         }
 
         if (field == DAY_OF_WEEK) {
             for (TextStyle textStyle : TextStyle.values()) {
-                Map<String, Integer> displayNames = CalendarDataUtility.retrieveCldrFieldValueNames(
+                Map<String, Integer> displayNames = CalendarDataUtility.retrieveJavaTimeFieldValueNames(
                         "gregory", Calendar.DAY_OF_WEEK, textStyle.toCalendarStyle(), locale);
                 Map<Long, String> map = new HashMap<>();
                 if (displayNames != null) {
                     for (Entry<String, Integer> entry : displayNames.entrySet()) {
                         map.put((long)toWeekDay(entry.getValue()), entry.getKey());

@@ -390,11 +390,11 @@
                 } else {
                     // Narrow names may have duplicated names, such as "S" for Sunday and Saturday.
                     // Get names one by one in that case.
                     for (int wday = Calendar.SUNDAY; wday <= Calendar.SATURDAY; wday++) {
                         String name;
-                        name = CalendarDataUtility.retrieveCldrFieldValueName(
+                        name = CalendarDataUtility.retrieveJavaTimeFieldValueName(
                             "gregory", Calendar.DAY_OF_WEEK, wday, textStyle.toCalendarStyle(), locale);
                         if (name == null) {
                             break;
                         }
                         map.put((long)toWeekDay(wday), name);

@@ -411,11 +411,11 @@
             for (TextStyle textStyle : TextStyle.values()) {
                 if (textStyle.isStandalone()) {
                     // Stand-alone isn't applicable to AM/PM.
                     continue;
                 }
-                Map<String, Integer> displayNames = CalendarDataUtility.retrieveCldrFieldValueNames(
+                Map<String, Integer> displayNames = CalendarDataUtility.retrieveJavaTimeFieldValueNames(
                         "gregory", Calendar.AM_PM, textStyle.toCalendarStyle(), locale);
                 if (displayNames != null) {
                     Map<Long, String> map = new HashMap<>();
                     for (Entry<String, Integer> entry : displayNames.entrySet()) {
                         map.put((long) entry.getValue(), entry.getKey());

@@ -476,11 +476,11 @@
      */
     @SuppressWarnings("unchecked")
     static <T> T getLocalizedResource(String key, Locale locale) {
         LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased()
                                     .getLocaleResources(locale);
-        ResourceBundle rb = lr.getFormatData();
+        ResourceBundle rb = lr.getJavaTimeFormatData();
         return rb.containsKey(key) ? (T) rb.getObject(key) : null;
     }
 
     /**
      * Stores the text for a single locale.