#253 Fails to get class info for exceptions

release_4.0
closed
7
2012-10-10
2004-10-12
No

The warning-level problem shows up for any exception
defined as part of the compilation unit.

Sample problem description:
"Unable to get class information for
InvalidMoveException."

Relevant method signature:
/ ..
@throws InvalidMoveException if an invalid move is
attempted
/
public void moveTo(Pin target) throws
InvalidMoveException { ... }

The exception is defined in the same package.

Discussion

<< < 1 2 (Page 2 of 2)
  • Lars Kühne
    Lars Kühne
    2004-10-17

    Logged In: YES
    user_id=401384

    OK, inside an eclipse plugin the bootclasspath trick will
    obviously not work.

    You said: "With Checkclipse Checkstyle is executing each
    time a code
    change is made - just as it should be - compiling prior of
    checking would defeat the purpose of the plug-in".

    I would question that. Checkstyle does not work on
    syntactically incorrect files, so Eclipse should first
    compile your java code, and only call checkstyle if
    compilation succeeded. Additionally, classes need to be
    compiled and checkstyle needs access to the class files
    before we can use the reflection API to analyse them (as you
    suggest and as we do for Exceptions)

    With the command line, letting checkstyle access the
    compiled classes is a bit tricky (involving the
    bootclasspath, and yes, we should change that), for the
    checkclipse plugin both prerequisites might not be
    satisfied. See also checkclipse release notes for version
    1.1.1 which talks about a problem with making the project
    classpath available to checkstyle, that classloader issue
    appearantly has never been fixed in later versions.

    Please notify the plugin author about this problem, we'd be
    happy to help him work out this issue.

    FYI exceptions are currently the only classes that we are
    trying to load from the classpath. All other elements are
    handled purely syntactically, we only analyse the Syntax
    tree of your java sources.

     
  • Logged In: YES
    user_id=746148

    I've committed fir for 1048226 into CVS for 4.0, thus I
    close this bug as fixed too

     
<< < 1 2 (Page 2 of 2)