Skip to content

Commit

Permalink
Corrected acceptable tokens for IllegalInstantiationCheck, issue #655
Browse files Browse the repository at this point in the history
  • Loading branch information
MEZk committed Aug 28, 2015
1 parent 0cc53f9 commit 69e5f93
Showing 1 changed file with 5 additions and 9 deletions.
Expand Up @@ -22,10 +22,7 @@
import java.util.Set;
import java.util.StringTokenizer;

import org.apache.commons.lang3.ArrayUtils;

import antlr.collections.AST;

import com.google.common.collect.Sets;
import com.puppycrawl.tools.checkstyle.api.Check;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
Expand Down Expand Up @@ -92,6 +89,11 @@ public class IllegalInstantiationCheck

@Override
public int[] getDefaultTokens() {
return getAcceptableTokens();
}

@Override
public int[] getAcceptableTokens() {
return new int[] {
TokenTypes.IMPORT,
TokenTypes.LITERAL_NEW,
Expand All @@ -100,12 +102,6 @@ public int[] getDefaultTokens() {
};
}

@Override
public int[] getAcceptableTokens() {
// Return an empty array to not allow user to change configuration.
return ArrayUtils.EMPTY_INT_ARRAY;
}

@Override
public int[] getRequiredTokens() {
return new int[] {
Expand Down

0 comments on commit 69e5f93

Please sign in to comment.