On 21 Sep 2015, at 15:52, Stephen Colebourne <scolebou...@joda.org> wrote:

> While I think I understand the need for the lambda/exception interface
> (backwards compatibility) it is definitely weird as a method
> signature.

Backwards compat has definitely influenced things, but the approach was also 
considered useful for new cases where customized exceptions/messages are 
required.


> 
> It would seem very worthwhile to add overloaded versions of each of
> these methods that do not have the OutOfBoundsToException in the
> argument list. Instead, these overloads would throw a "standard"
> exception.

That seems reasonable e.g.:

public static
int checkIndex(int index, int length) IndexOutOfBoundsException {
    return checkIndex(index, length, null);
}



> Such methods would then be much more amenable to just being
> dropped into existing application code, where the precise exception
> that is thrown is less of a concern.
> 

Though is passing “null” such a big deal?

Paul.

Reply via email to