8228465: HOST locale provider holds wrong era name for GregorianCalendar in US locale

Reviewed-by: lancea
This commit is contained in:
Naoto Sato 2019-07-26 13:32:59 -07:00
parent d711c4e18e
commit 11ab995e6c
3 changed files with 32 additions and 7 deletions

View file

@ -2205,7 +2205,8 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
}
String calendarType = getCalendarType();
if (style == ALL_STYLES || isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
if (style == ALL_STYLES || isStandaloneStyle(style) || isNarrowFormatStyle(style) ||
field == ERA && (style & SHORT) == SHORT) {
Map<String, Integer> map;
map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field, style, locale);