You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Phil Steitz <ph...@steitz.com> on 2003/06/14 23:21:07 UTC

[math] @throws IllegalArgumentException

I am dutifully cleaning up the CheckStyle warnings in my code and I am 
hesitating to remove @throws IllegalArgumentException, which CheckStyle 
currently complains about. I am a little ambivalent about this.  There 
is a property (checkstyle.javadoc.checkUnusedThrows) that we can set to 
make it ignore these. I notice that [lang] has this set to false. I 
actually prefer to leave these "unused throws tags" in. Any strong 
opinions on this?

Phil


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


Re: [math] @throws IllegalArgumentException

Posted by _matthewHawthorne <mh...@alumni.pitt.edu>.
FYI, I remember reading somehwere that adding runtime exceptions to a
method's throws clause is considered by Sun to be a bad practice.

However, after taking a quick look around online, I can't seem to find a
reference to this anywhere.  Maybe I'm mistaken.



On Sat, 2003-06-14 at 15:13, Phil Steitz wrote:
> Brent Worden wrote:
> >>-----Original Message-----
> >>From: Phil Steitz [mailto:phil@steitz.com]
> >>Sent: Saturday, June 14, 2003 4:21 PM
> >>To: Jakarta Commons Developers List
> >>Subject: [math] @throws IllegalArgumentException
> >>
> >>
> >>I am dutifully cleaning up the CheckStyle warnings in my code and I am
> >>hesitating to remove @throws IllegalArgumentException, which CheckStyle
> >>currently complains about. I am a little ambivalent about this.  There
> >>is a property (checkstyle.javadoc.checkUnusedThrows) that we can set to
> >>make it ignore these. I notice that [lang] has this set to false. I
> >>actually prefer to leave these "unused throws tags" in. Any strong
> >>opinions on this?
> >>
> >>Phil
> >>
> > 
> > 
> > I have no problem with it.
> > 
> > A better alternative might be to explicitly add runtime exceptions to the
> > throws clause of methods.  This doesn't effect callers as they're still not
> > required to add try-catch blocks. Plus, we could then leave the check enable
> > to catch any actual violations.
> 
> Much better idea. Thanks. Thought I had tried that, but I now see that 
> it works.
> 
> Phil
> 
> > 
> > Brent Worden
> > http://www.brent.worden.org
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> > 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 

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


Re: [math] @throws IllegalArgumentException

Posted by Phil Steitz <ph...@steitz.com>.
Brent Worden wrote:
>>-----Original Message-----
>>From: Phil Steitz [mailto:phil@steitz.com]
>>Sent: Saturday, June 14, 2003 4:21 PM
>>To: Jakarta Commons Developers List
>>Subject: [math] @throws IllegalArgumentException
>>
>>
>>I am dutifully cleaning up the CheckStyle warnings in my code and I am
>>hesitating to remove @throws IllegalArgumentException, which CheckStyle
>>currently complains about. I am a little ambivalent about this.  There
>>is a property (checkstyle.javadoc.checkUnusedThrows) that we can set to
>>make it ignore these. I notice that [lang] has this set to false. I
>>actually prefer to leave these "unused throws tags" in. Any strong
>>opinions on this?
>>
>>Phil
>>
> 
> 
> I have no problem with it.
> 
> A better alternative might be to explicitly add runtime exceptions to the
> throws clause of methods.  This doesn't effect callers as they're still not
> required to add try-catch blocks. Plus, we could then leave the check enable
> to catch any actual violations.

Much better idea. Thanks. Thought I had tried that, but I now see that 
it works.

Phil

> 
> Brent Worden
> http://www.brent.worden.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 




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


RE: [math] @throws IllegalArgumentException

Posted by Brent Worden <br...@worden.org>.
> -----Original Message-----
> From: Phil Steitz [mailto:phil@steitz.com]
> Sent: Saturday, June 14, 2003 4:21 PM
> To: Jakarta Commons Developers List
> Subject: [math] @throws IllegalArgumentException
>
>
> I am dutifully cleaning up the CheckStyle warnings in my code and I am
> hesitating to remove @throws IllegalArgumentException, which CheckStyle
> currently complains about. I am a little ambivalent about this.  There
> is a property (checkstyle.javadoc.checkUnusedThrows) that we can set to
> make it ignore these. I notice that [lang] has this set to false. I
> actually prefer to leave these "unused throws tags" in. Any strong
> opinions on this?
>
> Phil
>

I have no problem with it.

A better alternative might be to explicitly add runtime exceptions to the
throws clause of methods.  This doesn't effect callers as they're still not
required to add try-catch blocks. Plus, we could then leave the check enable
to catch any actual violations.

Brent Worden
http://www.brent.worden.org


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