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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to