Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 509967

Summary: Add support for conditional checkstyle off with @SuppressWarnings
Product: [Modeling] Sirius Reporter: Stephane Begaudeau <stephane.begaudeau>
Component: RelengAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: pierre-charles.david
Version: 4.1.1Keywords: triaged
Target Milestone: 5.0.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/88169
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7e06882c5ef6c062273e93bdba6319be0be2aac4
Whiteboard:

Description Stephane Begaudeau CLA 2017-01-05 04:46:06 EST
Update the checkstyle configuration to support the conditional removal of checkstyle errors. Instead of this:

// CHECKSTYLE:OFF
...
// CHECKSTYLE:ON

We could thus use:

@SuppressWarnings({ "checkstyle:multiplestringliterals" })
public final class GapPatternGenerator {
    ...
}

It allows the removal of the validation of specific checkstyle errors on a specific Java scope (class, method, field, etc) while keeping all the other kind of check activated.


See: http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarnings#SuppressWarningsHolder
Comment 1 Pierre-Charles David CLA 2017-01-05 04:50:26 EST
Moving to 5.0; we'll probably need to upgrade the version of CheckStyle we use when we start to really use Java 8-specific features, so it will be a good opportunity to review and improve our CheckStyle profile, and this point could be part of it.
Comment 2 Eclipse Genie CLA 2017-01-06 09:25:44 EST
New Gerrit change created: https://git.eclipse.org/r/88169
Comment 4 Pierre-Charles David CLA 2017-02-20 04:23:27 EST
I suppose this can be closed?
Comment 5 Stephane Begaudeau CLA 2017-02-20 04:29:21 EST
Closing this issue since it has been merged
Comment 6 Pierre-Charles David CLA 2017-06-29 03:31:44 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.