commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Sterijevski <gsterijev...@gmail.com>
Subject Re: [Math] MathUtils.checkOrder
Date Wed, 21 Sep 2011 23:33:38 GMT
Gilles,

I do not understand why a non-monotone collection should throw a
IllegalArgumentException...? There is nothing wrong with the argument, it
just is not in corrected order. Wouldn't it be better to return a false?

We have:

            if (!ok && abort) {
                throw new NonMonotonousSequenceException(val[i], previous,
i, dir, strict);
            }

Why throw this? Why not return false and let the code calling this method
decide if it wants to throw an exception?

On Wed, Sep 21, 2011 at 5:56 PM, Gilles Sadowski <
gilles@harfang.homelinux.org> wrote:

> On Wed, Sep 21, 2011 at 05:17:59PM -0500, Greg Sterijevski wrote:
> > Meant to say add, not replace. My apologies. -Greg
>
> I like this better! ;-)
> [But, still, please check the intended meaning of the first argument of
> (sub-classes of) "MathIllegalArgumentException".]
>
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message