diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/IllegalInstantiationCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/IllegalInstantiationCheck.java index 9c33275c4..ce325d34c 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/IllegalInstantiationCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/IllegalInstantiationCheck.java @@ -81,7 +81,26 @@ public class IllegalInstantiationCheck TokenTypes.PACKAGE_DEF }; } - + + /** + * Prevent user from changing tokens in the configuration. + * @see com.puppycrawl.tools.checkstyle.api.Check + */ + public int[] getAcceptableTokens() + { + return new int[] {}; + } + + /** @see com.puppycrawl.tools.checkstyle.api.Check */ + public int[] getRequiredTokens() + { + return new int[] { + TokenTypes.IMPORT, + TokenTypes.LITERAL_NEW, + TokenTypes.PACKAGE_DEF + }; + } + /** @see com.puppycrawl.tools.checkstyle.api.Check */ public void beginTree() {