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

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 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 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

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();`. --