commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: svn commit: r1030464 [1/3] - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/ main/java/org/apache/commons/math/analysis/ main/java/org/apache/commons/math/analysis/integration/ main/java/org/apache/commons/math/analysis/inte
Date Fri, 05 Nov 2010 15:20:05 GMT
Hello.

> >> So go ahead with the change, removing the throws from the declaration but keeping
the javadoc as suggested previously.
> >
> > Again, what is it that you try to convey by specifying a single exception in
> > the Javadoc? Any unchecked exception can be thrown from a class that
> > implement the interface.
> > If the user code doesn't care that the evaluation fails, it should catch
> > everything and continue. Alternatively, if it cannot continue, it should let
> > the exception propagate. In either case, there isn't any useful information
> > from a Javadoc "@throws" tag: We already know that unchecked exceptions can
> > arise.
> 
> I don't know if it's relevant here, but it's standard practice in lots
> of code I've seen to document unchecked exceptions in the @throws
> block if your code explicitly throws it.

This would be the minimum, but it seems that CM tries to be better in that
it aims at also documenting the exceptions thrown from the called code.
Of course it is more work on the part of the developer and also more
difficult do check for consistency when reading the code (short of following
all the calls).

> However I would not put this
> tag on the interface method declaration, because maybe some
> implementation doesn't throw that exception. [...]

+1


Best,
Gilles


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


Mime
View raw message