Re: [numbers] NUMBERS-40: Exception Consistency

2020-02-03 Thread Miguel Munoz
Maybe some examples would be helpful.

-- Miguel Muñoz






On Sunday, February 2, 2020, 02:17:29 AM PST, Gilles Sadowski 
 wrote: 





Hi.

2020-01-26 16:54 UTC+01:00, Matt Juntunen :
> 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-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



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



Re: [numbers] NUMBERS-40: Exception Consistency

2020-02-02 Thread Gilles Sadowski
Hi.

2020-01-26 16:54 UTC+01:00, Matt Juntunen :
> 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-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [numbers] NUMBERS-40: Exception Consistency

2020-02-01 Thread Matt Juntunen
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 
Sent: Sunday, January 26, 2020 10:54 AM
To: Commons Developers List 
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