Fork me on GitHub


By students from around the world.


Main idea of Checkstyle project is to automate and to ease code-review process; to assist developers in complying with the company's Code-standard, and allow them to fix and eliminate any minor problem upon just saving the file. We are strongly convinced that it is much more easier and convenient to catch minor traps in code during writing than after committing/pushing. This project contains a number of Checks that can help program engineers to write code in a uniform style, which makes it easier for the whole team of programmers to review the code, also significantly improves the low threshold of understanding for new developers.

This project is additional(non-standard) checks for Checkstyle that are compiled as extension to maven-checkstyle-plugin, Sonar Checkstyle Plugin, CheckStyle-IDEA, Checkstyle Eclipse plugin, see Distribution chapter for more details. See Javadoc pages for documentation of Check option.

This project is incubator for Checkstyle checks that are not present in main stream of Checkstyle project. If you have a check and need place to be build-in, let us know.
If you want to study Java(with mentoring) and help us develop some Checks let us know, we are looking for new maintainers and level of Java experience does not matter.

We offer diversity of nonstandard Checks and each developer's group chooses what to use to satisfy their code-standard needs.


Roman Ivanov: ivanov-jr[*]mail[*]ru

Discussion group

Homepage: discussion group

Group email: sevntu-checkstyle[ a ]


#sevntu.checkstyle on Freenode


- extension to maven-checkstyle-plugin (how to use: in general, maven example, ant example).
- extension to Sonar Checkstyle Plugin (how to use: in general).
- extension to CheckStyle-IDEA (how to use: in general).
- extension to Checkstyle Eclipse plugin how to use: install from EclipseCS “update site” or use our update site (do not use this link in Browser, it will return 404 code, it is expected, but it will work well through Eclipse menu "Help"->"Install New Software ...")

Examples of usage

Full list of Checks and examples of usage could be found at cofig that checkstyle project use.

New and noteworthy

Release 1.21.0 (08/June/2016)

new UniformEnumValueCheck -  Check forces enum values to match one of the specified patterns and forces all the values to follow only one of the specified patterns. . Done by Pavel Baranchikov. More

new javadoc for all Checks -  Fix all javadoc problems in sevntu-checks project. JAVADOC IS HERE. Done by Daniil Yaroslavtsev and Roman Ivanov. More

update for ConstructorWithoutParamsCheck -  Udpdate the default config in ConstructorWithoutParamsCheck. Done by zerg-junior. More

Release 1.20.0 (25/March/2016)

new ConstructorWithoutParamsCheck -  This check prohibits usage of parameterless constructors, including the default ones. Rationale: constructors of certain classes must always take arguments to properly instantiate objects. Done by Sergey Dudoladov. More

new properties for AvoidModifiersForTypes -  New options: forbiddenClassesRegexpAnnotation, forbiddenClassesRegexpPrivate, forbiddenClassesRegexpPackagePrivate, forbiddenClassesRegexpProtected, forbiddenClassesRegexpPublic. Done by Yasser Aziza. More

Release 1.19.2 (20/March/2016)

bug -  False positive in DiamondOperatorForVariableDefinitionCheck . Done by Vladislav Lisetskiy. More

Release 1.19.1 (10/March/2016)

bug -  Sevntu Sonar plugin 1.19.0 does not work with Sonar 5.3. Done by Charlie Pai. More

bug -  NumericLiteralNeedsUnderscore fails sonar project analysis. Done by Charlie Pai. More

Release 1.19.0 (8/March/2016)

bug -  NumericLiteralNeedsUnderscore: New option to skip fields by regexp. Done by Charlie Pai. More

version update -  Eclispe-cs version is 1.16.0, checkstyle 1.16.1. Done by Roman Ivanov.

Release 1.18.0 (17/January/2016)

new SingleBreakOrContinue -  This check restricts the number of break and continue statements inside cycle body (only one is allowed). Done by Yasser Aziza. More

new NumericLiteralNeedsUnderscore -  This check verifies that large numeric literals are spaced by underscores. Done by Charlie Pai. More

bug -  Rename checks to follow Checkstyle convention for check names. Checks AvoidDefaultSerializableInInnerClasses, ForbidCCommentsInMethods, ReturnBooleanFromTernary, ReturnNullInsteadOfBoolean renamed to have "Check" as suffix in name. Done by Andrei Selkin. More

Release 1.17.1 (14/December/2015)

bug -  Fix false-positive on methods called from 'super' at StaticMethodCandidateCheck. Done by Vladislav Lisetskiy. More

bug -  Fix false-positive on methods with varargs at StaticMethodCandidateCheck. Done by Vladislav Lisetskiy. More

bug -  Shade Guava in sonar-plugin . Done by Vladislav Lisetskiy. More

Release 1.17.0 (8/November/2015)

new StaticMethodCandidateCheck -  Checks whether private methods can be declared as static. Done by Vladislav Lisetskiy. More

bug -  Fix WhitespaceBeforeArrayInitializer for jagged arrays . Done by Michal Kordas. More

Release 1.16.1 (28/October/2015)

bug -  Cannot initialize module SingleSpaceSeparator. Done by Roman Ivanov. More

Release 1.16.0 (25/October/2015)

new SingleSpaceSeparatorCheck -  Checks that if tokens are separated by whitespaces, it has to be a single space. Done by Robert Whitebit.

version bump -  Update Maven Checkstyle Plugin to 2.17 . Done by Michal Kordas.

Release 1.15.0 (8/October/2015)

version bump -  Version bump to Eclipse-CS 6.11.0 . Done by David Ignjić.

version bump -  Version bump to checkstyle 6.11.2 . Done by David Ignjić.

bug -  CauseParameterInExceptionCheck: NullPointerException occurred during the analysis. Done by David Ignjić. More

Release 1.14.0 (26/September/2015)

version bump -  Version bump to Eclipse-CS 6.9.0 . Done by Roman Ivanov.

Release 1.13.6 (7/September/2015)

bug -  LogicConditionNeedOptimizationCheck doesn't give violation when it is expected. Done by Vadim Panasiuk. More

bug -  AvoidNotShortCircuitOperatorsForBooleanCheck: NullPointerException occurred during the analysis. Done by Christian Oyarzun. More

bug -  Cannot set property 'blockTypes' in module ChildBlockLength. Done by Christian Oyarzun. More

Release 1.13.5 (23/June/2015)

bug -  sevntu-checks are failed within Sonar because of the outdated checkstyle-extensions.xml. Done by Ruslan Diachenko. More

Release 1.13.4 (21/June/2015)

bug -  Sonar fails to start with 'Extension to Sonar Checkstyle Plugin 1.13.3'. Done by Ruslan Diachenko. More

Release 1.13.3 (7/June/2015)

bug -  ReturnNullInsteadOfBoolean: Remove FastStack reference that was removed from checkstyle 6.7. Done by Roman Ivanov. More

Release 1.13.2 (7/June/2015)

bug -  DiamondOperatorForVariableDefinitionCheck throws NullPointerException. Done by Roman Ivanov. More

Release 1.13.1 (6/June/2015)

bug -  PublicReferenceToPrivateTypeCheck fails on all files in eclipse-cs. Done by Roman Ivanov. More

Release 1.13.0 (16/May/2015)

VariableDeclarationUsageDistanceCheck -  was moved to Checkstyle library. Done by Roamn Ivanov.

AbbreviationAsWordInNameCheck -  was moved to Checkstyle library. Done by Roamn Ivanov.

NEW RequiredParameterForAnnotationCheck -  Check that annotation is used with all required parameters. Done by Andrew Uljanenko. More

NEW UselessSuperCtorCallCheck -  Checks for useless "super()" calls in ctors. Done by Zuy Alexey. More

NEW EmptyPublicCtorInClassCheck -  This Check looks for useless empty public constructors. Class constructor is considered useless by this Check if and only if class has exactly one ctor, which is public, empty (one that has no statements) and default. Done by Zuy Alexey. More

NEW NameConventionForJunit4TestClassesCheck -  This check verifies the name of JUnit4 test class for compliance with user defined naming convention. Done by Zuy Alexey. More

NEW UselessSingleCatchCheck -  Checks for the presence of useless single catch blocks. Catch block can be considered useless if it is the only catch block for try, contains only one statement which rethrows catched exception. Done by Zuy Alexey. More

NEW AvoidConditionInversion -  This Check helps to catch condition inversion cases which could be rewritten in a more readable manner. Done by Alexey Kravin. More

NEW NestedSwitchCheck -  Checking if there is no switch block inside other switch block. Done by Damian Szczepanik. More

Bug -  fix for NPE in ConfusingConditionCheck. Done by melodicwing.

Bug -  Fixed false positive in check ForbidReturnInFinallyBlockChech. Done by Andrew Uljanenko. More

Bug -  Diamond operator - fixed violations on anonymous classes. Done by Alexey Kravin. More

Release 1.12.0 (9/Oct/2014)

Update in Redundant Return Check -  Redundant Return Check was retested and fixed. Done by Alexey Nesterenko. More

Update in ForbidThrowAnonymousExceptionsCheck -  Reduced ForbidThrowAnonymousExceptionsCheck's limitation. Now this Check puts violation on throwing anonymous exception even in case if it is defined before throwing. Done by Alexey Nesterenko. More

Update in LineLengthCheck -  Updated LineLengthCheck to print the current line length in it's warnings. Done by Alexey Nesterenko. More

DiamondOperatorForVariableDefinitionCheck -  This Check highlights variable definition statements where diamond operator could be used. Done by Alexey Nesterenko. More

PublicReferenceToPrivateTypeCheck -  This Check warns on propagation of inner private types to outer classes:
- Externally accessible method if it returns private inner type.
- Externally accessible field if it's type is a private inner type.
These types could be private inner classes, interfaces or enumerations. Done by Alexey Nesterenko. More

TernaryPerExpressionCountCheck -  Replaced existing NestedTernaryCheck with more general TernaryPerExpressionCountCheck.
New Check provides options to ignore ternary sequences with explicitly set priority level (expressions in braces) and also to force Check to ignore ternary operators which are isolated inside a single line. Done by Alexey Nesterenko. More

Update in CustomDeclarationOrderCheck -  Updated Check to treat more king of methods as setters. E.g., now Check treats 'set' method as setter, in cases like:

public void setWorkMode(String workMode) {
this.workMode = WorkMode.valueOf(workMode);
public void setUserCache(UserCache userCache) {
public void setY(Integer y) { // setter
this.y = Integer.parseInt(y + "");

Done by Alexey Nesterenko. More

Release 1.11.0 (7/May/2014)

Update for CustomDeclarationOrderCheck -  New macros for Fields with assigning to Anonymous classes, macros for Setter/Geter, macros for nested interfaces and nested enumarations macros for "main()" method. Done by Baratali Izmailov. More

EnumValueNameCheck -  Check forces enum values to match the specific pattern. Done by Pavel Baranchikov. More

CheckFinalizeImplementation -  This Check detects 3 most common cases of incorrect finalize() method implementation. Done by Max Vetrenko. More

ForbidThrowAnonymousExceptions -  Forbid throwing anonymous exception. limitation: This Check does not validate cases then Exception object is created before it is thrown. Done by Max Vetrenko. More

MapIterationInForEachLoopCheck -  This check can help you to write the whole for-each map iteration more correctly. Done by Max Vetrenko. More

update in deployment scipt -  Fixed -all mode in Done by Ashutosh Agarwal. More

Release 1.10.0 (24/Nov/2013)

New project! sevntu-checkstyle-sonar-plugin -  Project was created as extension to Sonar Checkstyle Plugin for SonarQube™, How to use it is described here in detail and pictures, Done by Ruslan Diachenko. More.

New project! sevntu-checkstyle-idea-extension -  Project was created as extension for Checkstyle IDEA plugin for IntelliJ IDEA, How to use it is described here in details and pictures, Done by Vadim Panasiuk. More.

Update for CustomDeclarationOrderCheck -  Inner Classes in methods are ignored. Done by Baratali Izmailov. More

Updates in messages -  Done by Baratali Izmailov, Ilja Dubinin, Vadim Panasiuk. More

Update in VariableDeclarationUsageDistanceCheck -  Update to support block constructions/builders and methods with long list arguments,Done by Baratali Izmailov. More

Update in ConfusingConditionCheck -  Update to skip alarming on sequentional IF, Done by Vadim Panasiuk. More

Update in NoNullForCollectionReturnCheck -  Fix for NullPointerException,Done by Ilja Dubinin. More

Update in ForbidCertainImportsCheck -  additional field as Regexp for excluding imports from checking,Done by Daniil Yaroslavtsev. More

Release 1.9.0 (18/Sept/2013)

AvoidConstantAsFirstOperandInConditionCheck -  Avoid Constant As First Operand In Condition. If comparing values, C(C++) developers prefer to put the constant first in the equality check, to prevent situations of assignment rather than equality checking. But in Java, in IF condition it is impossible to use assignment, so that habit become unnecessary and do damage readability of code.
if (null == varialble)"
should be
if (varialble == null)"
Done by Sergey Burtsev.  More

EitherLogOrThrowException -  Either log the exception, or throw it, but never do both. Logging and throwing results in multiple log messages for a single problem in the code, and makes problems for the support engineer who is trying to dig through the logs. This is one of the most annoying error-handling antipatterns.
catch (NoSuchMethodException e) { LOG.error("Blah", e); throw e; }
Done by Baratali Izmailov.  More

ForbidWildcardAsReturnTypeCheck -  Do not use wildcard types as return types. Rather than providing additional flexibility for your users, it would force them to use wildcard types in client code. Properly used, wildcard types are nearly invisible to users of a class. They cause methods to accept the parameters they should accept and reject those they should reject. If the user of a class has to think about wildcard types, there is probably something wrong with the class’s API.
public <T> List<? extends T> getValues()
Done by Baratali Izmailov.  More

NoNullForCollectionReturnCheck -  Check detect when method, that must return array or collection, return null value instead of empty collection or empty array.
public List<String> metValues() { return null; }
Done by Ilja Dubinin.  More

ConfusingConditionCheck -  This check prevents negation within an "if" expression if "else" is present.
For example, rephrase:
if (x != y) smth1(); else smth2();
if (x == y) smth2(); else smth1();
Done by Vadim Panasiuk.  More.
Examples of usage and all options description is here.

NoMainMethodInAbstractClassCheck -  Forbids main methods in abstract classes. Rationale: existance of 'main' method can mislead a developer to consider this class as a ready-to-use implementation.
abstract class AbstractUiJob {... public static void main(String args[]){ ... } ... }
Done by Baratali Izmailov.  More

SimpleAccessorNameNotationCheck -  Check only direct fields and setter and getter. Options: 1) member prefix "m_" 2) check only simple getter/setter XXXType getXXXName(); void setXXXName(XXXType).
private String value;
void setValue(String val) { this.value = val;}
Reimplemented and fixed by Ilja Dubinin.  More

AbbreviationAsWordInNameCheck -  problem detection of 2 char abbreviation with length limit 1 was fixed.
int scaleX;
Done by Baratali Izmailov.  More

Release 1.8.0 (16/Apr/2012)

NestedTernaryCheck - This check forbids nested ternary operators (with option to ignore final variable initializations except initializations inside C-tors).
Done by Daniil Yaroslavtsev.  (issue)

ForbidReturnInFinallyBlockCheck -  This check reports if the finally block contains a return statement.
Done by Vadim Panasiuk.  (issue).

Update for ChildBlockLengthCheck to show current sizes of 'bad' blocks, not only allowed sizes for it.
Done by Daniil Yaroslavtsev.  More

Fixed bugs in AvoidHidingCauseExceptionCheck -  More information: issue.
Done by Ilja Dubinin. 

Fixed bugs in OverridableMethodInConstructorCheck -  More information: issue. Also added new option that allow compare methods by number of their parameters.
Done by Ilja Dubinin.  

Update for ReturnCountCheckExtended -  Now RegExp is used in ignored list of methods.
Done by Alexey Grigorov. 

Release 1.7.0 (15/Nov/2012)

AvoidConstantsInInterfacesCheck -  has been removed as it has been already implemented in standart Checkstyle. Done by Vadym Chekrii. 

Release 1.6.2 (12/Nov/2012)

AbbreviationAsWordInNameCheck - problem with constants in interfaces was fixed. Done by Roman Ivanov.  issue

Release 1.6.1 (29/Oct/2012)

Changes for descriptions for Eclipse plugin for checks that appear in 1.6.0. Done by Ilja Dubinin and Roman Ivanov.

Release 1.6.0 (21/Oct/2012)

LogicConditionNeedOptimizationCheck -  This check prevents the placement of local variables and fields after calling methods in '&&' and '||' conditions. Done by Ilja Dubinin. Patch.

ForbidCCommentsInMetods -  Check prevents usage of C-style (/* ... */) comments inside method body. If you have class declaration inside method body with JavaDoc you will get error too. Done by Ilja Dubinin. Patch.

InterfaceTypeParameterNameCheck -  Checks that interface type parameter(for template) names conform to a format specified by the format property. Default format is ^[A-Z]$. Done by Dmitry Gridyushko. Patch.

Release 1.5.3 (4/Sept/2012)

Internal release for site generation automation, refactoring of projects structure to be more independend from main project and ease code managment and ease new developers unserstanding of project, extension for maven plugin was introduced. Done By Ivan Sopov with help of Ilia Dubinin, Dmitry Gridyushko.

Release 1.5.0 (12/Jun/2012)

AvoidDefaultSerializableInInnerClasses - This check prevents the default implementation Serializable interface in inner classes (Serializable interface are default if methods readObject() or writeObject() are not override in class). Check has option, that allow implementation only one method, if it true, but if it false - class must implement both methods. For more information read "Effective Java (2nd edition)" chapter 11, item 74, page 294. Done by Ilia Dubinin.  issue

IllegalCatchCheck - Minor fix for default values. Done by Daniil Yaroslavtsev. 

Release 1.0.5 (14/Apr/2012)

ChildBlockLengthCheck - Length of child block that is more then 90% of parent block is hard to read in case child block is long(few display screens). Done by Daniil Yaroslavtsev.  issue

AvoidModifiersForTypesCheck - Disallow some set of modifiers (Only 4 types according to Java Spec:static,final, transient, volatile) for specified types, caused by static for ULCComponents. Done by Daniil Yaroslavtsev.  issue

CauseParameterInExceptionCheck - Exception Design Best Practices : Cause now needed as one the parameter in any custom Exception constructor. Done by Daniil Yaroslavtsev.  issue

ForbidsCertainImportsCheck - Forbids certain imports usage. Is similar to the useful check in Sonar project. Done by Daniil Yaroslavtsev.  issue

ForbidInstantiationCheck - Forbids instantiation of certain object types by their full classname. For example: "java.lang.NullPointerException" will forbid the NPE instantiation. Done by Daniil Yaroslavtsev.  issue

ReturnCountExtendedCheck - Checks that method/ctor "return" literal count is not greater than the given value ("maxReturnCount" property). has many useful ignore options. Done by Daniil Yaroslavtsev.  issue

AbbreviationAsWordInNameCheck - XMLReader should be names like XmlReader. Issue for ignoring methods with annotation @Override was fixed. Done by Daniil Yaroslavtsev.  issue

Release 1.0.4 (11/Oct/2011)

ForbidAnnotationCheck - Forbid specific annotation for field/method, e.g. forbid @Autowired annotation for private field. Done by Victor Hidoyatov.  issue

AvoidConstantsInInterfacesCheck - avoid declaration of constants in interfaces. Done by Vladimir Svikhunov.  issue.

AvoidHidingCauseExceptionCheck - hiding Cause exception in throwing new exception. Done by Daniil Yaroslavtsev.  issue.

AvoidNotShortCircuitOperatorsForBooleanCheck - Forbid to use "|", "|=", "&" for boolean/Boolean variables, and force to use "||", .... , explanation link. Example: "boolean b |= returnBoolean()". Done by Daniil Yaroslavtsev.  issue.

IllegalCatchCheck - Options to ignore 1) exact re-throw after logging 2) creation and throw of other Exception base on current exception. Done by Daniil Yaroslavtsev.  issue.

OverridableMethodInConstructorCheck - Do not use protected/public method in C-tor. Use only private and final. Check all call hierarchy from c-tor to avoid: c-tor -> private -> public/protected. Done by Daniil Yaroslavtsev. (issue.

ReturnBooleanFromTernary - It is a bad practice to return boolean values from ternary operations. Just use the value inside branch instead. Done by Ivan Sopov.

ReturnNullInsteadOfBoolean - Arguably it is the matter of style to use Boolean for ternary logic or enum. And since all the information is in the single file and even in the single method, I think that checkstyle is capable of doing this. Done by Ivan Sopov. (issue)

VariableDeclarationUsageDistanceCheck - check distance between declaration of variable and its first usage of it. Options: Allowed distance (in rows); Ignore variable names (regexp). Done by Ruslan Diachenko.  issue

AbbreviationAsWordInNameCheck - XMLReader should be names like XmlReader. Checks names for fields, methods , ....... . Few ignore options. Done by Roman Ivanov. (issue).

Release 1.0.2 (15/Mar/2011)

AvoidNotShortCircuitOperatorsForBooleanCheck - check to force user not to use ShortCircuit operators ("|", "&" for boolean calculations) . Done by Daniil Yaroslavtsev. patch

MultipleStringLiteralsExtendedCheck - extension of the standart check, newoption was added to highlight all duplicated. Done by Yury Balahonov. patch

MultipleVariableDeclarationsExtendedCheck - stndard check + option to ignore while/for. Done by Daniil Yaroslavtsev. patch

UnnecessaryParenthesesExtendedCheck - standart check + option to ignore some arguable cases. Dmitriy Antonenko. patch

Release 1.0.1 (21/Sept/2010)

CustomDeclarationOrderCheck - check to adjust class structure to make it more predictable. Done by Danil Lopatin. acticle in russian patch and example of config

InnerClassCheck - force user to place inner classes at the bottom ofthe class. Done by Ruslan Dyachenko. patch

AbstractClassNameExtendedCheck - extension to check if you named class AbstractXXXXXX then force user to keep it "abstract". Done by Danil Lopatin. patch

LineLengthExtendedCheck - extension of standard check with a lot of ignore option. Done by Ruslan Dyachenko. patch

Examples and ideas

Examples of how to use SevNTU-Checkstyle with Maven, Ant or Gradle you can find at checkstyle-samples repo.

GSOC 2013 ideas


You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://