There are only two (context) forms of styles: FORMAT and STANDALONE. If
one form fails, the fallback part will try the other form. It's not
necessary to try again the first form.
The code may become clearer if method toFormatStyle() was defined. But
the operation is the same thing as getBaseStyle() which is used to get
the width information (LONG, SHORT, NARROW) which is the same thing as
its format form, e.g., Calendar.LONG == Calendar.LONG_FORMAT.
Masayoshi
On 3/28/2015 4:31 AM, Martin Buchholz wrote:
Don't know much about Calendar, but:
do you want below to try fallback twice? Eg. if it's still null after
trying toStandaloneStyle(style), do you want to also try fallback to
getBaseStyle(style) ?
2093 // Perform fallback here to follow the CLDR rules
2094 if (val == null) {
2095 if (isNarrowFormatStyle(style)) {
2096 val =
CalendarDataUtility.retrieveFieldValueName(calendarType,
2097
field, fieldValue,
2098
toStandaloneStyle(style),
2099
locale);
2100 } else if (isStandaloneStyle(style)) {
2101 val =
CalendarDataUtility.retrieveFieldValueName(calendarType,
2102
field, fieldValue,
2103
getBaseStyle(style),
2104
locale);
2105 }
2106 }
On Fri, Mar 27, 2015 at 1:48 AM, Masayoshi Okutsu
<masayoshi.oku...@oracle.com <mailto:masayoshi.oku...@oracle.com>> wrote:
Hi,
Please review the fix for 8075548. This change is to follow the
fallback rules of the format-standalone names specified by the
alias tag in CLDR.
Bug report:
https://bugs.openjdk.java.net/browse/JDK-8075548
Webrev:
http://cr.openjdk.java.net/~okutsu/9/8075548/webrev.00
<http://cr.openjdk.java.net/%7Eokutsu/9/8075548/webrev.00>
Thanks,
Masayoshi