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: svn commit: r1034457 - in /commons/proper/math/branches/MATH_2_X/src: main/java/org/apache/commons/math/ main/java/org/apache/commons/math/exception/ main/java/org/apache/commons/math/linear/ main/java/org/apache/commons/math/ode/ site/xdoc/
Date Fri, 12 Nov 2010 22:39:20 GMT
Le 12/11/2010 23:15, Gilles Sadowski a écrit :
>>>> [...]
>>>> Hence, I would propose to create a new "MathRuntimeException" (in package
>>>> "exception") and move all the code currently in "MathIllegalArgumentException"
>>>> over to that class.
>>>> Then, "MathIllegalArgumentException" as well as "MathUserException" can
>>>> inherit from it.
>>>>
>>>> What do you think?
>>>
>>> No problem for me.
>>
>> OK, I'll do it in trunk. Then you can copy it over to MATH_2_X.
> 
> I've been to fast on this.
> "MathIllegalArgumentException" cannot inherit from "MathRuntimeException"
> (which itself inherits from "RuntimeException") because it must inherit from
> "IllegalArgumentException" to maintain the required semantics!
> 
> So we'll have code duplication in "MathIllegalArgumentException" and in
> "MathRuntimeException". This is 3 instance fields, 2 constructors and 3 methods.
> 
> An alternative: Instead of the 3 fields, we could store an instance of
> "MathRuntimeException" inside "MathIllegalArgumentException" and redirect
> the 3 method calls to that instance.
> 
> Even simpler would be to have "MathUserException" inherit from
> "MathIllegalArgumentException"...
> 
> Which do you prefer?

I would prefer the simpler code duplication here. It is only an
exception, and has no complex behavior.

Luc

> 
>> [...]
> 
> 
> Regards,
> Gilles
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


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


Mime
View raw message