Disabling Checkstyle inline

Brent Putman putmanb at georgetown.edu
Fri Aug 2 13:27:17 EDT 2013


I decided to try out the mechanism Daniel illustrated for selectively
disabling a Checkstyle rule for a particular block of code. In short, it
didn't work.  By which I mean the warning doesn't go away in Eclipse.  I
did do a project clean, then a "Checkstyle -> Clear Checkstyle
Violoations" which did clear the warning as expected.  I then did a
project build, and the warning came back, despite the comments to turn
it off.  Am I doing something wrong, or is this known to not work in the
Eclipse plugin?


Here's what I did in code:

// CheckStyle:AvoidInlineConditionals OFF
log.warn("Configuration.getGlobalSecurityConfiguration did not produce
an instance of " +
        "BasicSecurityConfiguration, could not apply custom security
configuration settings: {}",
                config == null ? "null" : config.getClass().getName());
// CheckStyle:AvoidInlineConditionals ON


More information about the dev mailing list