Help save net neutrality! Learn more.
Close

#88 unused throws tag with Error

release_2.4
closed
None
5
2012-10-10
2002-07-19
Paul Guyot
No

Checkstyle properly doesn't report that throws tag are
unused if they mention a subclass of RuntimeException.
However, it does report it for throws tag mentioning Error.

Discussion

  • Oliver Burn

    Oliver Burn - 2002-07-21

    Logged In: YES
    user_id=218824

    Could you please supply an example file. I do not understand
    the request.

     
  • Paul Guyot

    Paul Guyot - 2002-07-22

    Logged In: YES
    user_id=163572

    Checkstyle complains that second throws tag is unused here:

    /
    * Do something interesting.

    * @throws SomeCheckedException if bar is <code>null</code>.
    * @throws Error if foobar is <code>null</code>.
    /
    protected void foo() throws SomeCheckedException {
    if (bar == null) {
    throw new SomeCheckedException();
    }
    if (foobar == null) {
    throw new Error("foobar is null");
    }
    }

     
  • Oliver Burn

    Oliver Burn - 2002-07-31

    Logged In: YES
    user_id=218824

    thanks for the example, now I understand.

    Having read the Javadoc for Error, I would suggest that what
    you using for in the example is bad practice. Still, I
    acknowledge the bug in Checkstyle and will fix it.

     
  • Paul Guyot

    Paul Guyot - 2002-07-31

    Logged In: YES
    user_id=163572

    Indeed it is bad practice, but I'm commenting code I haven't
    written ;)

    Thanks for the support.

     
  • Oliver Burn

    Oliver Burn - 2002-08-04

    Logged In: YES
    user_id=218824

    This is a request for new functionality, not a bug in the existing
    code. Hence, changed the type to a feature request.

     
  • Oliver Burn

    Oliver Burn - 2002-08-04

    Logged In: YES
    user_id=218824

    fixed - changes in CVS

     

Log in to post a comment.