commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <Luc.Maison...@free.fr>
Subject Re: [math] Restoring IAE to MathUtils#binomialCoefficient methods
Date Sat, 30 Apr 2011 20:05:40 GMT
Fine for me

Luc


Phil Steitz <phil.steitz@gmail.com> a écrit :

Converting some of my code to use trunk, I discovered that the binomialCoefficient methods
no longer throw IllegalArgumentException when parameters are invalid. The javadoc asserts
that MathIllegalArgumentException will be thrown in these cases, but that is not correct,
since what is actually thrown now can differ depending on the parameter problem and the resulting
exceptions are neither standard IAEs nor descendents of MathIAE. I have patched the code to
return a standard IAE (with localized message). Per discussion in [1] it looks like we were
close to consensus to favor standard exceptions and in this case, I would much rather return
a standard IAE with meaningful error message rather than a non-standard RTE (with exactly
the same error message and generally confusing type - e.g. "NumberIsTooSmall" when n, k parameters
are not in the right order) and keep the javadoc simple. Otherwise, the main method javadoc
has to be rewritten to conform to what the code now does. Are t
 here
any objections to this change? Phil [1] *http://s.apache.org/nr*_____________________________________________
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