#257 Runtime problems of Checks are logged to checkstyle audit

release_4.0
closed
5
2012-10-10
2004-10-16
Lars Kühne
No

Several checks currently log runtime problems to the
auditing system, e.g. RedundantThrows might generate
"Unable to get class information for InvalidMoveException."

These kind of messages should not go into the audit
report (which should only list the problems in the code
that has been inspected). Instead they should either be
reported to the log (e.g. appear in ant's build log) or
raise an exception and stop checkstyle - not sure which
approach is better, comments are welcome.

Discussion

  • Logged In: YES
    user_id=746148

    The question is: if we don't log "runtime problems of
    Checks" to audit log then we may
    silently skip problemmatic code. How to notify user that
    he/she have some problems
    in environment which should be fixed for proper work of the
    Checks?

     
  • Lars Kühne
    Lars Kühne
    2004-10-22

    Logged In: YES
    user_id=401384

    Oleg, that's what I meant to address in the "raise an
    exception and stop checkstyle" part of the request.

    For example in the Ant task, we could simply throw a
    BuildException. In other words, the user would not even see
    an HTML page with audit results because the <style> task
    would not be executed. The failure message would be the last
    entry in Ant's build log / console output.

     
  • Logged In: YES
    user_id=746148

    Ok. the latter approach is more preferrable for me.
    Are you going to work on this bug right now?
    If not ,please assign it to me and I will fix this.

     
  • Lars Kühne
    Lars Kühne
    2004-10-22

    Logged In: YES
    user_id=401384

    I don't have time to work on this bug atm, but I would
    investigate simply throwing an exception inside the check
    and let the caller of Checker.process() catch it.

    I consider this a high risk bug fix. It will probably break
    the build for some users that didn't care about an
    occasional internal error message in their checkstyle
    reports. Please consider fixing this only on the trunc and
    not on v3-branch.

     
  • Logged In: YES
    user_id=746148

    I've committed the fix to CVS for 4.0