> > > [...]
> > > 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?

> [...]


Regards,
Gilles

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

Reply via email to