You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "J.Pietschmann" <j3...@yahoo.de> on 2003/09/26 22:13:13 UTC

[math] Exceptions again...

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.

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


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


Re: [math] Exceptions again...

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.

J.Pietschmann wrote:
> james@carmanconsulting.com wrote:
> 
>> Why not just use NestableException in Commons Lang?
> 
> 
> Has been proposed
>  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
> apaprently included in some patch
>  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
> but last I checked it wasn't in the repository.
> 

My fault, I started to work on BeanTransformer prior to this patch, I 
was trying to resolve my work and the changes in the Patch. I pushed it 
off due to my needing to focus on projects my employer was pushing me to 
complete. I'd like to get back to it now. I'll try to look at it tonite.




> Personally, I'd be ok with requiring 1.4 for the stated reasons,
> but if the majority finds the added dependency is worth the effect
> of 1.3 compatiblity, so be it.
> 
> J.Pietschmann
> 


-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu


Re: [math] Exceptions again...

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.

J.Pietschmann wrote:
> james@carmanconsulting.com wrote:
> 
>> Why not just use NestableException in Commons Lang?
> 
> 
> Has been proposed
>  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
> apaprently included in some patch
>  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
> but last I checked it wasn't in the repository.
> 

My fault, I started to work on BeanTransformer prior to this patch, I 
was trying to resolve my work and the changes in the Patch. I pushed it 
off due to my needing to focus on projects my employer was pushing me to 
complete. I'd like to get back to it now. I'll try to look at it tonite.




> Personally, I'd be ok with requiring 1.4 for the stated reasons,
> but if the majority finds the added dependency is worth the effect
> of 1.3 compatiblity, so be it.
> 
> J.Pietschmann
> 


-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu


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


Re: [math] Exceptions again...

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.
Let me review the patch again. Then I'll have an opinion.

-Mark

james@carmanconsulting.com wrote:

> I would agree that requiring 1.4 should be okay, since it IS a sandbox
> component and nobody should be using it "in production" anyway.
> 
> ----- Original Message ----- 
> From: "J.Pietschmann" <j3...@yahoo.de>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Friday, September 26, 2003 4:56 PM
> Subject: Re: [math] Exceptions again...
> 
> 
> 
>>james@carmanconsulting.com wrote:
>>
>>
>>>Why not just use NestableException in Commons Lang?
>>
>>Has been proposed
>>
> 
> http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
> 
>>apaprently included in some patch
>>
> 
> http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
> 
>>but last I checked it wasn't in the repository.
>>
>>Personally, I'd be ok with requiring 1.4 for the stated reasons,
>>but if the majority finds the added dependency is worth the effect
>>of 1.3 compatiblity, so be it.
>>
>>J.Pietschmann
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu


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


Re: [math] Exceptions again...

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.
Let me review the patch again. Then I'll have an opinion.

-Mark

james@carmanconsulting.com wrote:

> I would agree that requiring 1.4 should be okay, since it IS a sandbox
> component and nobody should be using it "in production" anyway.
> 
> ----- Original Message ----- 
> From: "J.Pietschmann" <j3...@yahoo.de>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Friday, September 26, 2003 4:56 PM
> Subject: Re: [math] Exceptions again...
> 
> 
> 
>>james@carmanconsulting.com wrote:
>>
>>
>>>Why not just use NestableException in Commons Lang?
>>
>>Has been proposed
>>
> 
> http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
> 
>>apaprently included in some patch
>>
> 
> http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
> 
>>but last I checked it wasn't in the repository.
>>
>>Personally, I'd be ok with requiring 1.4 for the stated reasons,
>>but if the majority finds the added dependency is worth the effect
>>of 1.3 compatiblity, so be it.
>>
>>J.Pietschmann
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu


Re: [math] Exceptions again...

Posted by ja...@carmanconsulting.com.
I would agree that requiring 1.4 should be okay, since it IS a sandbox
component and nobody should be using it "in production" anyway.

----- Original Message ----- 
From: "J.Pietschmann" <j3...@yahoo.de>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Friday, September 26, 2003 4:56 PM
Subject: Re: [math] Exceptions again...


> james@carmanconsulting.com wrote:
>
> > Why not just use NestableException in Commons Lang?
>
> Has been proposed
>
http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
> apaprently included in some patch
>
http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
> but last I checked it wasn't in the repository.
>
> Personally, I'd be ok with requiring 1.4 for the stated reasons,
> but if the majority finds the added dependency is worth the effect
> of 1.3 compatiblity, so be it.
>
> J.Pietschmann
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>


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


Re: [math] Exceptions again...

Posted by ja...@carmanconsulting.com.
I would agree that requiring 1.4 should be okay, since it IS a sandbox
component and nobody should be using it "in production" anyway.

----- Original Message ----- 
From: "J.Pietschmann" <j3...@yahoo.de>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Friday, September 26, 2003 4:56 PM
Subject: Re: [math] Exceptions again...


> james@carmanconsulting.com wrote:
>
> > Why not just use NestableException in Commons Lang?
>
> Has been proposed
>
http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
> apaprently included in some patch
>
http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
> but last I checked it wasn't in the repository.
>
> Personally, I'd be ok with requiring 1.4 for the stated reasons,
> but if the majority finds the added dependency is worth the effect
> of 1.3 compatiblity, so be it.
>
> J.Pietschmann
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>


Re: [math] Exceptions again...

Posted by "J.Pietschmann" <j3...@yahoo.de>.
james@carmanconsulting.com wrote:

> Why not just use NestableException in Commons Lang?

Has been proposed
  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
apaprently included in some patch
  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
but last I checked it wasn't in the repository.

Personally, I'd be ok with requiring 1.4 for the stated reasons,
but if the majority finds the added dependency is worth the effect
of 1.3 compatiblity, so be it.

J.Pietschmann



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


Re: [math] Exceptions again...

Posted by "J.Pietschmann" <j3...@yahoo.de>.
james@carmanconsulting.com wrote:

> Why not just use NestableException in Commons Lang?

Has been proposed
  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106304647620410&w=2
apaprently included in some patch
  http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=106369042012878&w=2
but last I checked it wasn't in the repository.

Personally, I'd be ok with requiring 1.4 for the stated reasons,
but if the majority finds the added dependency is worth the effect
of 1.3 compatiblity, so be it.

J.Pietschmann



Re: [math] Exceptions again...

Posted by ja...@carmanconsulting.com.
Why not just use NestableException in Commons Lang?

----- Original Message ----- 
From: "J.Pietschmann" <j3...@yahoo.de>
To: <co...@jakarta.apache.org>
Sent: Friday, September 26, 2003 4:13 PM
Subject: [math] Exceptions again...


> 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.
> 
> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

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


Re: [math] Exceptions again...

Posted by ja...@carmanconsulting.com.
Why not just use NestableException in Commons Lang?

----- Original Message ----- 
From: "J.Pietschmann" <j3...@yahoo.de>
To: <co...@jakarta.apache.org>
Sent: Friday, September 26, 2003 4:13 PM
Subject: [math] Exceptions again...


> 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.
> 
> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

RE: [math] Exceptions again...

Posted by Brent Worden <br...@worden.org>.
> 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


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


RE: [math] Exceptions again...

Posted by Brent Worden <br...@worden.org>.
> 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