You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Steve Cohen <st...@attbi.com> on 2002/05/01 04:47:55 UTC

Checkstyle and RuntimeExceptions

In Joshua Bloch's "Effective Java" he makes a point of stating that writers 
of Javadoc comments should be ESPECIALLY interested in documenting runtime 
exceptions that are NOT listed in the throws clause (as in fact, they're not 
required to be).  Makes good sense to me, since you're not required to list 
these, how else are you going to warn users of your class that such may be 
thrown?

However, the default settings of CheckStyle, at least those in use in the 
commons/sandbox/net project, seem to militate against doing this.  Document a 
runtime exception that may be thrown without putting it in the throws clause 
and you'll get one of these errors:

Unused @throws tag for 'IllegalArgumentException'.

Is this setting really the way we want it to be?
 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Checkstyle and RuntimeExceptions

Posted by Pete Kazmier <pe...@kazmier.com>.
I also opened up a feature request on this issue on 4/22:

http://sourceforge.net/tracker/index.php?func=detail&aid=547098&group_id=29721&atid=397081

On Wed, May 01, 2002 at 05:35:40AM -0500, Steve Cohen wrote:
> Thanks, Michael.  I have appended part of my remarks as a comment in support 
> of yours to your bug report.
> 
> On Tuesday 30 April 2002 11:04 pm, you wrote:
> > On Tue, 30 Apr 2002, Steve Cohen wrote:
> > > In Joshua Bloch's "Effective Java" he makes a point of stating that
> > > writers of Javadoc comments should be ESPECIALLY interested in
> > > documenting runtime exceptions that are NOT listed in the throws clause
> > > (as in fact, they're not required to be).  Makes good sense to me, since
> > > you're not required to list these, how else are you going to warn users
> > > of your class that such may be thrown?
> > >
> > > However, the default settings of CheckStyle, at least those in use in the
> > > commons/sandbox/net project, seem to militate against doing this. 
> > > Document a runtime exception that may be thrown without putting it in the
> > > throws clause and you'll get one of these errors:
> > >
> > > Unused @throws tag for 'IllegalArgumentException'.
> > >
> > > Is this setting really the way we want it to be?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Checkstyle and RuntimeExceptions

Posted by Steve Cohen <st...@attbi.com>.
Thanks, Michael.  I have appended part of my remarks as a comment in support 
of yours to your bug report.

On Tuesday 30 April 2002 11:04 pm, you wrote:
> On Tue, 30 Apr 2002, Steve Cohen wrote:
> > In Joshua Bloch's "Effective Java" he makes a point of stating that
> > writers of Javadoc comments should be ESPECIALLY interested in
> > documenting runtime exceptions that are NOT listed in the throws clause
> > (as in fact, they're not required to be).  Makes good sense to me, since
> > you're not required to list these, how else are you going to warn users
> > of your class that such may be thrown?
> >
> > However, the default settings of CheckStyle, at least those in use in the
> > commons/sandbox/net project, seem to militate against doing this. 
> > Document a runtime exception that may be thrown without putting it in the
> > throws clause and you'll get one of these errors:
> >
> > Unused @throws tag for 'IllegalArgumentException'.
> >
> > Is this setting really the way we want it to be?
>
> This is a bug in checkstyle.  I filed a bug report at the beginning of
> April:
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=540382&group_id=29
>721&atid=397078
>
> regards,
> michael

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Checkstyle and RuntimeExceptions

Posted by "Michael A. Smith" <ma...@apache.org>.
On Tue, 30 Apr 2002, Steve Cohen wrote:
> In Joshua Bloch's "Effective Java" he makes a point of stating that writers 
> of Javadoc comments should be ESPECIALLY interested in documenting runtime 
> exceptions that are NOT listed in the throws clause (as in fact, they're not 
> required to be).  Makes good sense to me, since you're not required to list 
> these, how else are you going to warn users of your class that such may be 
> thrown?
> 
> However, the default settings of CheckStyle, at least those in use in the 
> commons/sandbox/net project, seem to militate against doing this.  Document a 
> runtime exception that may be thrown without putting it in the throws clause 
> and you'll get one of these errors:
> 
> Unused @throws tag for 'IllegalArgumentException'.
> 
> Is this setting really the way we want it to be?

This is a bug in checkstyle.  I filed a bug report at the beginning of 
April:

http://sourceforge.net/tracker/index.php?func=detail&aid=540382&group_id=29721&atid=397078

regards,
michael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>