Details
-
Bug
-
Resolution: Fixed
-
P3
-
8
-
-
b78
-
generic
-
generic
Description
Demo code:
Locale l = new Locale("ja", "JP", "JP");
Chrono.getAvailableChronologies(); // work around to force init Chrono
Chrono c = Chrono.ofLocale(l);
DateTimeFormatter l10nF = DateTimeFormatters.localizedDateTime(FormatStyle.FULL, FormatStyle.FULL)
.withChrono(c).withLocale(l);
This piece throws the following exception:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at sun.util.locale.provider.CalendarNameProviderImpl.getDisplayName(CalendarNameProviderImpl.java:61)
at sun.util.locale.provider.CalendarDataUtility$CalendarFieldValueNameGetter.getObject(CalendarDataUtility.java:110)
at sun.util.locale.provider.CalendarDataUtility$CalendarFieldValueNameGetter.getObject(CalendarDataUtility.java:95)
at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObjectImpl(LocaleServiceProviderPool.java:299)
at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObject(LocaleServiceProviderPool.java:283)
at sun.util.locale.provider.CalendarDataUtility.retrieveFieldValueName(CalendarDataUtility.java:68)
at java.time.format.DateTimeTextProvider.getEraText(DateTimeTextProvider.java:184)
at java.time.format.DateTimeFormatterBuilder$TextPrinterParser.print(DateTimeFormatterBuilder.java:2362)
at java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.print(DateTimeFormatterBuilder.java:1567)
at java.time.format.DateTimeFormatterBuilder$LocalizedPrinterParser.print(DateTimeFormatterBuilder.java:3260)
at java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.print(DateTimeFormatterBuilder.java:1567)
at java.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:335)
at java.time.format.DateTimeFormatter.print(DateTimeFormatter.java:307)
Locale l = new Locale("ja", "JP", "JP");
Chrono.getAvailableChronologies(); // work around to force init Chrono
Chrono c = Chrono.ofLocale(l);
DateTimeFormatter l10nF = DateTimeFormatters.localizedDateTime(FormatStyle.FULL, FormatStyle.FULL)
.withChrono(c).withLocale(l);
This piece throws the following exception:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at sun.util.locale.provider.CalendarNameProviderImpl.getDisplayName(CalendarNameProviderImpl.java:61)
at sun.util.locale.provider.CalendarDataUtility$CalendarFieldValueNameGetter.getObject(CalendarDataUtility.java:110)
at sun.util.locale.provider.CalendarDataUtility$CalendarFieldValueNameGetter.getObject(CalendarDataUtility.java:95)
at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObjectImpl(LocaleServiceProviderPool.java:299)
at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObject(LocaleServiceProviderPool.java:283)
at sun.util.locale.provider.CalendarDataUtility.retrieveFieldValueName(CalendarDataUtility.java:68)
at java.time.format.DateTimeTextProvider.getEraText(DateTimeTextProvider.java:184)
at java.time.format.DateTimeFormatterBuilder$TextPrinterParser.print(DateTimeFormatterBuilder.java:2362)
at java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.print(DateTimeFormatterBuilder.java:1567)
at java.time.format.DateTimeFormatterBuilder$LocalizedPrinterParser.print(DateTimeFormatterBuilder.java:3260)
at java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.print(DateTimeFormatterBuilder.java:1567)
at java.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:335)
at java.time.format.DateTimeFormatter.print(DateTimeFormatter.java:307)