commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel Munoz <swingguy1...@yahoo.com.INVALID>
Subject Re: [numbers] NUMBERS-40: Exception Consistency
Date Tue, 04 Feb 2020 03:24:31 GMT
Maybe some examples would be helpful.

-- Miguel Muñoz






On Sunday, February 2, 2020, 02:17:29 AM PST, Gilles Sadowski <gilleseran@gmail.com>
wrote: 





Hi.

2020-01-26 16:54 UTC+01:00, Matt Juntunen <matt.juntunen@hotmail.com>:
> Hello,
>
> I'm looking into NUMBERS-40, which suggests that the exception behavior of
> commons-numbers (specifically the gamma package) needs to be made more
> consistent. Below is a summary of the public exception types explicitly
> thrown by each module.
>
> arrays
>        IndexOutOfBoundsException
>        IllegalArgumentException
>
> combinatorics
>        IllegalArgumentException
>        NoSuchElementException
>        UnsupportedOperationException
>
> complex
>        NumberFormatException
>        IllegalArgumentException
>
> complex-streams
>        IllegalArgumentException
>
> core
>        ArithmeticException
>        IllegalArgumentException
>
> fraction
>        ArithmeticException
>        IllegalArgumentException
>
> gamma
>        IllegalArgumentException

Some methods throw "ArithmeticException" while others throw
"IllegalArgumentException".  IIRC, my issue was whether there
were cases where the behaviour is not consistent from a
user POV (IOW, where the same behaviour would be expected).

[Note: I did not review all the packages.  But I don't recall there
were this kind of issue.]

Gilles


>
> primes
>        IllegalArgumentException
>
> quaternion
>        NumberFormatException
>        IllegalArgumentException
>        IllegalStateException
>
> rootfinder
>        IllegalArgumentException
>
>
> Nothing in this list strikes me as being inconsistent. The types are all
> standard JDK exception types and seem to be used appropriately, IMO. Is
> there any work that needs to be done on this issue?
>
> Regards,
> Matt J

>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message