Hi Paul, hi chris,
----- Mail original -----
> De: "Chris Hegarty" <[email protected]>
> À: "Paul Sandoz" <[email protected]>
> Cc: "core-libs-dev" <[email protected]>
> Envoyé: Jeudi 24 Septembre 2015 11:06:36
> Objet: Re: RFR 8135248: Add utility methods to check indexes and ranges
>
> On 24 Sep 2015, at 08:40, Paul Sandoz <[email protected]> wrote:
>
> > On 23 Sep 2015, at 18:11, Rémi Forax <[email protected]> wrote:
> >>>
> >>> Because i want to support the simple cases without pulling in indy.
> >>
> >> and what about using an anonymous class instead ?
> >>
> >
> > Not an anonymous one, but i think i know what you mean :-)
it can be an anonymous one:
private static final BiFunction<Integer, Integer, IOOBE> DEFAULT = new
BiFunction<>() { ... };
anyway ...
> >
> > Also, i don’t want to impose a null check of the exception mapping function
> > for every call, which would push the null check to when the values are out
> > of bounds, and throwing an NPE in such cases seems mean when one can
> > easily throw IOOBE instead.
>
> This does seem to be one of the rare cases where accepting null is the lesser
> of two evils, given the expected usage of the API.
yes, i agree, it's a kind of ugly but it seems a necessary evil.
[...]
>
> -Chris.
Rémi