ModifiedControlVariable: don't apply to enhanced for loops
This commit is contained in:
parent
633b270172
commit
78b24a265d
2 changed files with 3 additions and 3 deletions
|
@ -1415,8 +1415,6 @@ for (int i = 0; i < 1; i++) {
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
> TODO: skipEnhancesForLoopVariable = true
|
|
||||||
|
|
||||||
#### [ModifierOrder](http://checkstyle.sourceforge.net/config_modifier.html#ModifierOrder)
|
#### [ModifierOrder](http://checkstyle.sourceforge.net/config_modifier.html#ModifierOrder)
|
||||||
|
|
||||||
Check that modifiers are in the following order:
|
Check that modifiers are in the following order:
|
||||||
|
|
|
@ -132,7 +132,9 @@
|
||||||
<module name="MethodParamPad"/> <!-- verifies padding around method parameters -->
|
<module name="MethodParamPad"/> <!-- verifies padding around method parameters -->
|
||||||
<module name="MissingDeprecated"/> <!-- @Deprecated annotation must be accompanied by javadoc @deprecated -->
|
<module name="MissingDeprecated"/> <!-- @Deprecated annotation must be accompanied by javadoc @deprecated -->
|
||||||
<module name="MissingSwitchDefault"/> <!-- switch must have a default -->
|
<module name="MissingSwitchDefault"/> <!-- switch must have a default -->
|
||||||
<module name="ModifiedControlVariable"/> <!-- prevent for loop control being modified inside loop -->
|
<module name="ModifiedControlVariable"> <!-- prevent for loop control being modified inside loop -->
|
||||||
|
<property name="skipEnhancedForLoopVariable" value="true"/> <!-- doesn't apply to for(String line : lines) {} -->
|
||||||
|
</module>
|
||||||
<module name="ModifierOrder"/> <!-- enforce order: public protected private abstract static final transient volatile synchronized native strictfp -->
|
<module name="ModifierOrder"/> <!-- enforce order: public protected private abstract static final transient volatile synchronized native strictfp -->
|
||||||
<module name="MultipleStringLiterals"/> <!-- merge string literals -->
|
<module name="MultipleStringLiterals"/> <!-- merge string literals -->
|
||||||
<module name="MultipleVariableDeclarations"/> <!-- declare variables separately -->
|
<module name="MultipleVariableDeclarations"/> <!-- declare variables separately -->
|
||||||
|
|
Loading…
Reference in a new issue