commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Worden" <br...@worden.org>
Subject RE: [math] Exceptions again...
Date Sat, 27 Sep 2003 04:44:28 GMT
> Hi,
> I found that [math] still wont compile on JDK 1.3 due to the
> super(throwable) constructors in MathException. Should we just write
> off 1.3 users, now that a reasonable 1.4 is available on basically
> all platforms which run Java at all?
> Unless I'm mistaken, Brent's patch contained some corrections for
> this problem.

Yes.  I should be the one Mark just applied.  It's using
o.a.c.lang.NestedException like James mentioned.

>
> Further, there still wasn't a conclusion on what to do with
> analysis.ConvergenceException, which is used in util.ContinuedFraction
> only, and also is a RuntimeException instead of a checked Exception.
>
> Point one: given the current code, it seems to be misplaced.
>
> Point two: Falling out of the loops in the root finders actually
> indicates a convergence problem (either too stringent accuracy settings,
> ill conditioned functions causing oscillations or a bug in the algorithm)
> I'd like to use a ConvergenceException for this condition too, however,
> throwing a mix of checked and unchecked exceptions for conditions of
> comparable complexity is something I'd rather avoid.
>
> Possible solutions:
> 1. abolish ConvergenceException completely and replace it in
>   ContinuedFraction by a (checked) MathException. This will cause
>   adding a "throws MathException" in a heck of a lot of places,
>   including on gamma and beta functions and everywhere they are used.
>   The discussion whether the kind of functions should throw a checked
>   exception wans't conclusive yet.
> 2. derive ConvergenceException from MathException (and palce it in
>   [math] root), further see above.
> 3. make MathException a runtime exception and replace
>   ConvergenceException with a MathException.
> 4. make MathException a runtime exception and derive
>    ConvergenceException from MathException.
> 5. Leave as is but move ConvergenceExcpetion to [math] root
> 6. as 5 but move to [math]/util
>
> Any ideas/recomendations/votes?
>
> J.Pietschmann
>

I'm for 2 with the addendum that the beta and gamma functions catch it and
return NaN much like the functions in java.lang.Math.

Brent Worden
http://www.brent.worden.org


Mime
View raw message