commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [math] Re: Single root for Exceptions
Date Wed, 29 Aug 2012 22:04:54 GMT

To summarize:
 (1) Does anyone disagree with having all CM exceptions inherit
     from a new "MathRuntimeException" which itself will inherit
     from the standard "RuntimeException"?
 (2) Does anyone disagree with all exceptions being mandatorily
     advertized in the "throws" clause of methods and constructors?
     That means that for each exception explicitly instantiated in the
     body of the method, the instantiated type must appear in "throws"
 (3) Does anyone disagree that the "throws" clause of a method could
     advertize "MathRuntimeException" for any exception not thrown by
     itself but by a method which it calls?
     That means that it is not mandatory to indicate the specific type
     for exceptions not explicitly instantiated in the body the current

I'm not sure about point (3); it seems that it would avoid duplicating
descriptions of lower-level preconditions for CM methods that calls other CM
methods or advertizing something that would be an implementation detail for
the calling method. I didn't check how often that would apply...
At first sight, that would surely avoid that upper levels are tightly
coupled to lower levels: if a method is modified to throw a new exception,
methods that call it do not have to update their documentation and "throws"


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message