Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#139 Problem with RedundantThrows check

release_3.1
closed
5
2012-10-10
2003-08-08
No

Hi,
I think I got a problem with RedundantThrows. The class
imports looked like this

import java.text.ParseException;
import other.package.IdentifierNotAvailableException;

and both do not inherit from each other. When running
checkstyle on a method declaration like

void doSomething()
throws IdentifierNotAvailableException, ParseException
{
}

I got the following warning

XXX.java:276:16: Redundant throws: 'ParseException' is
subclass of 'IdentifierNotAvailableException'.
XXX.java:276:16: Unable to get class information for
IdentifierNotAvailableException.
XXX.java:276:32: Unable to get class information for
IdentifierNotAvailableException.

Is this an error in the Check or are my settings wrong?

Discussion

  • Logged In: YES
    user_id=746148

    You should specify classpath to locate class info for these
    exception.
    For ant tast you should specify <classpath> property of
    Checkstyle task.
    For command line you should set CLASSPATH env var or use
    -classpath flag.

    Please, confirm that this is resolve your problem .