You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Matt Juntunen <ma...@hotmail.com> on 2020/02/02 03:44:36 UTC

Re: [numbers] NUMBERS-40: Exception Consistency

Hello,

If no one has any objections to the current exception usage in commons-numbers, I suggest we close NUMBERS-40. This would allow us to continue with the beta release (as mentioned in another thread).

-Matt
________________________________
From: Matt Juntunen <ma...@hotmail.com>
Sent: Sunday, January 26, 2020 10:54 AM
To: Commons Developers List <de...@commons.apache.org>
Subject: [numbers] NUMBERS-40: Exception Consistency

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

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