RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Andrey Turbanov
Parameter `ChronoField field` is checked by `if (field instanceof ChronoField)`. Such check is confusing, because only one case, when this could be `false` is when `field == null`. But if condition is not satisfied we will get immediate NullPointerException anyway in `return field.range();`. --

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Roger Riggs
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Naoto Sato
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Daniel Fuchs
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

Re: RFR: 8280470: Confusing instanceof check in HijrahChronology.range

2022-01-21 Thread Iris Clark
On Mon, 17 Jan 2022 21:02:35 GMT, Andrey Turbanov wrote: > Parameter `ChronoField field` is checked by `if (field instanceof > ChronoField)`. Such check is confusing, because only one case, when this > could be `false` is when `field == null`. > But if condition is not satisfied we will get imm

RFR: 8280474: Garbage value passed to getLocaleInfoWrapper in HostLocaleProviderAdapter_md

2022-01-21 Thread Daniel Jeliński
Reported by clang-tidy. Verified manually by running Calendar c = Calendar.getInstance(); System.out.println (c.getDisplayNames(Calendar.MONTH, Calendar.SHORT_STANDALONE, Locale.getDefault())); with `-Djava.locale.providers=HOST` Without the fix the WINAPI functions fail, and [t

Re: RFR: 8280474: Garbage value passed to getLocaleInfoWrapper in HostLocaleProviderAdapter_md

2022-01-21 Thread Naoto Sato
On Fri, 21 Jan 2022 19:28:21 GMT, Daniel Jeliński wrote: > Reported by clang-tidy. Verified manually by running > > Calendar c = Calendar.getInstance(); > System.out.println (c.getDisplayNames(Calendar.MONTH, > Calendar.SHORT_STANDALONE, Locale.getDefault())); > > with `-Djava.

Re: Additional Date-Time Formats

2022-01-21 Thread Naoto Sato
Thanks, Joe. Good point. I will elaborate the pattern template part more, less depending on the LDML spec. Would have been better if we could introduce our own, such as ofLocalizedPattern(Set template), but not exactly suffices the need. Naoto On 1/20/22 9:52 PM, Joe Wang wrote: Hi Naoto