Fix FallThrough check violation in code, issue #945

This commit is contained in:
Michal Kordas 2015-05-02 15:27:07 +02:00 committed by Roman Ivanov
parent a2b8be14bb
commit a0acabc125
2 changed files with 5 additions and 1 deletions

View File

@ -243,6 +243,7 @@
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="FallThrough"/>
<!--
<module name="AbbreviationAsWordInName"/>
@ -257,7 +258,6 @@
<module name="EmptyForInitializerPad"/>
<module name="EmptyStatement"/>
<module name="ExecutableStatementCount"/>
<module name="FallThrough"/>
<module name="FinalParameters"/>
<module name="HiddenField"/>
<module name="IllegalToken"/>

View File

@ -263,9 +263,13 @@ public class EmptyLineSeparatorCheck extends Check
if (ast.getLineNo() > 1 && !hasEmptyLineBefore(ast)) {
log(ast.getLineNo(), MSG_SHOULD_BE_SEPARATED, ast.getText());
}
if (!hasEmptyLineAfter(ast)) {
log(nextToken.getLineNo(), MSG_SHOULD_BE_SEPARATED, nextToken.getText());
}
if (hasNotAllowedTwoEmptyLinesBefore(ast)) {
log(ast.getLineNo(), MSG_MULTIPLE_LINES, ast.getText());
}
break;
default:
if (nextToken.getType() != TokenTypes.RCURLY && !hasEmptyLineAfter(ast)) {
log(nextToken.getLineNo(), MSG_SHOULD_BE_SEPARATED, nextToken.getText());