Skip to content

Commit

Permalink
Empty Line Separator Check, fixed false-positive, issue checkstyle#530
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkravin committed Feb 1, 2015
1 parent 6b06645 commit 0aa3306
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Expand Up @@ -213,12 +213,15 @@ public void visitToken(DetailAST ast)
case TokenTypes.VARIABLE_DEF:
if (isTypeField(ast) && !hasEmptyLineAfter(ast)) {
if (allowNoEmptyLineBetweenFields
&& nextToken.getType() != TokenTypes.VARIABLE_DEF)
&& nextToken.getType() != TokenTypes.VARIABLE_DEF
&& nextToken.getType() != TokenTypes.RCURLY)
{
log(nextToken.getLineNo(), MSG_SHOULD_BE_SEPARATED,
nextToken.getText());
}
else if (!allowNoEmptyLineBetweenFields || !allowMultipleEmptyLines) {
else if ((!allowNoEmptyLineBetweenFields || !allowMultipleEmptyLines)
&& nextToken.getType() != TokenTypes.RCURLY)
{
log(nextToken.getLineNo(), MSG_SHOULD_BE_SEPARATED,
nextToken.getText());
}
Expand Down
Expand Up @@ -25,7 +25,7 @@
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.Collections;
import com.google.common.base.CharMatcher;

import com.google.common.io.CharSource;

import javax.swing.AbstractAction;
Expand Down Expand Up @@ -93,3 +93,19 @@ private InnerClass()
}
}
}

class Class2{
public int compareTo(InputEmptyLineSeparatorCheck aObject) //ok
{
int number = 0;
return 0;
}

Class2 anon = new Class2(){
public int compareTo(InputEmptyLineSeparatorCheck aObject) //ok
{
int number = 0;
return 0;
}
};
}

0 comments on commit 0aa3306

Please sign in to comment.