OpenJDK's Java Style Checkstyle Coverage
Useful information
This coverage report was created for OpenJDK Java Style (cached page), Draft v6, December 2015.
The OpenJDK style guide says that, apart from LF, the only allowed whitespace character is Space, and that \', \", \\, \t, \b, \r, \f, and \n should be preferred over corresponding octal or Unicode escaped characters.
Incomplete Checkstyle configuration for 'OpenJDK Java Style'
Legend
"???" - Report is incomplete in this line.
"--" - There is no rule in this paragraph.
"↓" - This paragraph is the high-level point of some group.
- Existing Check covers all requirements from OpenJDK.
- Existing Check covers some part of requirements from OpenJDK.
- Requirements are not possible to check by Checkstyle at all.
Coverage table
ATTENTION: Links to config and test in following table reference to latest (not released yet) config. Config might be slightly different from what we have in latest release. Please always use config that is embedded to jar or use a custom version copied from one that matches your checkstyle version.
| OpenJDK's Java Style Rule | Checkstyle Check | Applied to config | ||
|---|---|---|---|---|
|
Introduction | -- | ||
|
Motivation | -- | ||
|
Guiding Principles | -- | ||
|
Java Source Files |
charset=US-ASCII, LineEnding ( config) RegexpSingleline ( config) OuterTypeFilename ( config) |
samples | |
|
Special Characters |
IllegalTokenText ( config), AvoidEscapedUnicodeCharacters ( config) |
samples | |
|
Formatting | ??? | ||
|
Copyright notice | ??? | ||
|
Package declaration |
NoLineWrap ( config) |
samples | |
|
Import statements |
ImportOrder ( config) NoLineWrap ( config) UnusedImports ( config) |
samples | |
|
Wildcard Imports |
AvoidStarImport ( config) |
samples | |
|
Class Structure |
DeclarationOrder ( config) Factory Method is not covered by DeclarationOrder. Checkstyle is a static tool it can not determine the difference between normal and factory methods and also the relation between fields can not be determined. Ordering of nested types can not be covered until #19636 |
samples | |
|
Order of Constructors and Overloaded Methods |
OverloadMethodsDeclarationOrder ( config) ConstructorsDeclarationGrouping ( config) |
samples | |
|
Modifiers |
RedundantModifier ( config) Modifiers order can not be covered until: #19513 Checkstyle can not determine whether a final modifier increases the readability of method parameters and local variables and also we can not find is there any compelling reason present for a field which is declared as final. |
samples | |
|
Braces | ??? | ||
|
Short Forms | ??? | ||
|
Indentation |
FileTabCharacter ( config) Indentation ( config) |
samples | |
|
Wrapping Lines |
OneStatementPerLine ( config) |
samples | |
|
Wrapping Class Declarations | ??? | ||
|
Wrapping Method Declarations | ??? | ||
|
Wrapping Expressions |
OperatorWrap ( config) |
samples | |
|
Whitespace | ↓ | ||
|
Vertical Whitespace | ??? | ||
|
Horizontal Whitespace | ??? | ||
|
Variable Declarations |
MultipleVariableDeclarations ( config) ArrayTypeStyle ( config) VariableDeclarationUsageDistance ( config) |
samples | |
|
Annotations | ??? | ||
|
Lambda Expressions |
LambdaBodyLength ( config) |
samples | |
|
Redundant Parentheses |
MatchXpath ( config) Note: Automated enforcement of this rule is not supported, as determining whether redundant parentheses improve code readability requires human context and subjective judgment. |
samples | |
|
Literals |
UpperEll ( config) HexLiteralCase ( config) NumericalPrefixesInfixesSuffixesCharacterCase ( config) |
samples | |
|
Javadoc | ??? | ||
|
Naming | ↓ | ||
|
Package Names |
Note: Detection of plural forms or semantic word variations is not supported, as there is no valid method to do it. PackageName (config) |
samples | |
|
Class, Interface and Enum Names |
TypeName ( config) AbbreviationAsWordInName ( config) Checkstyle is a Static analysis tool. It lacks the linguistic dictionary and contextual awareness required to identify grammatical parts of speech like nouns or adjectives. Consequently, it cannot evaluate word meanings to judge whether an abbreviation is widely understood or if a term is being used correctly. |
samples | |
|
Method Names |
MethodName ( config) Method names should typically be verbs or other descriptions of actions. This cannot be fully covered because Checkstyle does not have English vocabulary to determine whether a method name is a verb or action description. |
samples | |
|
Variables | ??? | ||
|
Type Variables | ??? | ||
|
Constants |
ConstantName ( config) IllegalIdentifierName ( config) These checks partially covers the rule for constants because these can not determine whether two words are separated by underscore (_) or not. |
samples | |
|
Programming Practices | ??? | ||
|
Commenting Code | ??? | ||
|
When to reformat code | -- | ||
|
Cases not covered | -- |
Suppressions
It is possible to suppress some violations by embedded filters SuppressionFilter and SuppressionXpathFilter. Location of config file for SuppressionFilter can be defined by system property org.checkstyle.openjdk.suppressionfilter.config (default value is checkstyle-suppressions.xml). Location of config file for SuppressionXpathFilter can be defined by system property org.checkstyle.openjdk.suppressionxpathfilter.config (default value is checkstyle-xpath-suppressions.xml).
For more details please review exact configuration of Filters in openjdk_checks.xml: SuppressionFilter, SuppressionXpathFilter.






