Release 5.7

New features:

  • Support SuppressWarningsFilter to use @SuppressWarnings annotations to suppress violations. Thanks to Trevor Robinson for patch #156.
  • New: UniqueProperties check. Thanks to Pavel Baranchikov. #19
  • Support for '&' in nested generics. Thanks to dkomanov.
  • Allow HeaderCheck definition to be specified as URL. Thanks to tnarake.
  • Allow additional URL schemes for SuppressionFilter configuration. Thanks to tnarake.

Bug fixes:

  • added support for a separate throws indentation configuration
  • SuppressionCommentFilter ignores messageFormat. Patch from Chris Brigham.
  • Exclude some java.util classes from Class Fan out. Thanks to Ivan Sopov and Vincent Massol.#31
  • Allow to ignore java.lang and certain other classes. Thanks to Ivan Sopov and Vincent Massol.#33
  • RequireThisCheck doesn't check methods. Thanks to krzyk.#41
  • Document WhitespaceAround for-each property. Thanks to Andrew Gaul.#15
  • Other corrections for typos. Thanks to Andrew Gaul.#16
  • Remnants of DoubleCheckedLocking were removed. Thanks to Antonio Ospite.

Notes:

  • Improved the performance of FileText construction, which increased file loading times by up to 30%.
  • Upgraded dependencies to guava-jdk5 14.0.1 and JUnit 4.11.
  • partial fix for "Sonarqube found problems in Checkstyle" #46.
  • Remnants of DoubleCheckedLocking were removed. Thanks to Antonio Ospite.

Release 5.6

New features:

  • SuppressionFilter now supports loading a configuration from a URL reference. Thanks to Stephen for patch #3485185.

Bug fixes:

  • Fixed bug in the grammar for an edge case (bug #1667137). Thanks to Lukas Platinsky for patch #3393810.
  • DeclarationOrder handles ignoreModifiers correctly (all fields should be before ctors and methods)(bug #3429775)
  • Inner assignment is now allowed in try-with-resources (bug #3441097)
  • Fixed bug in the grammar when builtin types are used in a generic declaration (bug #3553541).

Notes:

  • Removed the DoubleCheckedLocking check, as in Java 5 (and beyond), using the volatile keyword addresses the issue. See here for more details.
  • Added Turkish message translations. Thanks to poyrazus for patch #3460908.

Release 5.5

New features:

  • Added Java 7 support to the grammar. Thanks to Dinesh Bolkensteyn for patch #3403265.

Bug fixes:

  • Fix parsing error unexpected char: 0xFFFF which was triggered when a comment line is on a line without newline character. Thanks to Evgeny Mandrikov for patch #3367782.
  • Fixed UnusedImports to consider @linkplain, @throws and @exception tags when the option processJavadoc is turned on.
  • RequireThis now ignores static members (bug #1155921).
  • HiddenField now treats setxYz() as a setter for xYz, and setXYz() as a setter for XYz property to comply JavaBeans specification (bug #3370946).
  • Fixed parsing errors for Unicode escape sequences. Thanks to Dinesh Bolkensteyn for patch #3412812.
  • ignoreEnhancedForColon property added to WhitespaceAround. Thanks to Travis Schneeberger for patch #1921815 (bug #1649038).

Release 5.4

New features:

  • Enhanced UnusedImports to have the option processJavadoc to detect whether imports are used. Thanks to Lyle Hanson for patch #3267984.
  • Enhanced MagicNumber to support ignoring numbers in annotation declarations. Thanks to Julio Cesar Cabral for patch #3132984.
  • Enhanced EqualsAvoidNull to process String.equalsIgnoreCase() invocations (which can be suppressed).
  • Enhanced IllegalThrows to support ignoring methods with specified names. Thanks to Amit Shah for patch #3115439.
  • Enhanced RedundantModifier to support detecting inner interface declarations that are declared as static. Raised in bug #3222810.
  • Enhanced the ANT task, Command Line and Suppression Filter to be able to load their configuration file from either the filesystem or the classpath as a resource. Thanks to Tracy Snell for patch #3307526.

Bug fixes:

  • Fix MultipleVariableDeclarations to properly handle when multiple variable declarations are inside a for loop initializer. Thanks to Amit Shah for patch #3121071.
  • Fix memory leak in FileContentsHolder. Thanks to Evgeny Mandrikov for patch #3323517.

Release 5.3

New features:

  • Added OuterTypeFilename that checks that the outer type name and the file name match. For example, the class Foo must be in a file named Foo.java.
  • Enhanced PackageDeclaration to optionally check that the package name matches the name of the directory containing the file.
  • Added NestedForDepth that restricts nested for blocks to a specified depth (default = 1). Thanks to Alexander Jesse for patch #1151673.
  • Added MethodCount that checks the number of methods declared in each type. This includes the number of each scope (private, package, protected and public) as well as an overall total. Thanks to Alexander Jesse for patch #1151669, which was the inspiration.
  • Added OneStatementPerLine that checks there is only one statement per line. Thanks to Alexander Jesse for patch #1144994, which was the inspiration.
  • Enhanced MagicNumber to support the parameter ignoreHashCodeMethod to ignore magic numbers in hashCode() methods. Thanks to Daniel Solano Gómez for patch #3050788.
  • Enhanced AbstractClassName to support checking that matching classes have the abstract modifier. Thanks to Danil Lopatin for patch #3043752.
  • Enhanced the property types stringSet and intSet to support being supplied multiple times to construct the equivalent of a comma separated list.
  • Enhanced AvoidStarImport to support the properties allowClassImports and allowStaticMemberImports for finer control over what is allowed. Thanks to Travis Schneeberger for patch #1939775.

Bug fixes:

  • Fix JavadocMethod checking of @throws tags for methods that throw multiple non-runtime exceptions. Thanks to Daan Kets for patch #3039869.
  • Fix HideUtilityClassConstructor to handle empty and inner classes. Thanks to Roman Ivanov for patch #3045720.

Notes:

  • Changed the default value of the property logLoadErrors to be true for the checks RedundantThrows and JavadocMethod to ensure consistent behaviour.

Release 5.2

New features:

  • Enhanced DeclarationOrder to support properties to ignore constructors, methods and modifiers. Thanks to Steve McKay for patch #2953941.
  • Enhanced WriteTag to support empty tags, and constructor declarations. Thanks to Rolf Wojtech for patch #2724894.
  • Added InnerTypeLast to check nested (internal) classes/interfaces are declared at the bottom of the class after all method and field declarations. Thanks to Ruslan Dyachenko for patch #3027391.
  • Enhanced ImportOrder to support using regular expressions for defining groups. Thanks to Martin von Gagern for patch #2782118.

Bug fixes:

  • Fixed ImportOrder to have the sort behaviour as in release 5.0. (bug #2952881). Thanks to Steve McKay for patch #2953936.
  • Fixed JavadocStyle not handling package declarations that have annotations. (bug #2911363)

Notes:

  • Converted the build system to Maven. The directory structure has been maintained for now, rather than adopting Maven's standard directory layout . This will change once Maven has been proven.
  • The Maven <groupId> changed to be com.puppycrawl.tools (from checkstyle).
  • Introduced FileText to provide more flexibility on how the contents of a file are represented. This allows for Checkers that wish to operate on a single character sequence instead of a list of lines. Thanks to Martin von Gagern for patch #2783226.
  • Updated third party dependencies to the latest versions. See Project Dependencies for details.
  • Made the method EmptyBlockCheck.hasText(DetailAST) as protected so that it is accessible to subclasses. Requested by Steve McKay.

Release 5.1

New features:

  • Enhanced ImportOrder check to support wildcard ('*') groups. Thanks to Steve McKay for patch #2891032.
  • Enhanced the naming checks ConstantName, MemberName, MethodName and StaticVariableName to utilise the access control tuning features of AbstractAccessControlNameCheck. Thanks to Steve McKay for patch #2893581.
  • Improve ConfigurationLoader to use a InputSource. Thanks to Martin von Gagern for patch #2782627.
  • Enhanced the ImportControl check to support regular expressions. Thanks to lbaeumer for patch #2937442.

Bug fixes:

  • Corrected build errors on javadoc generation. Thanks to Martin von Gagern for providing a patch (patch #2782630).
  • Corrected javadoc in TokenTypes class for UNARY_PLUS and UNARY_MINUS members (bug #2745145).
  • Corrected broken link in WhiteSpaceAround documentation (bug #2745287).
  • Corrected pad policy documentation for MethodParamPad (bug #2775402).
  • Added correct license information for referenced source files (bug #2778850).
  • Updated documentation for writing checks (bug #2783451).
  • Report unused Javadoc tags with no trailing whitespace(bug #2506962). Thanks to Ashlesha Patil for patch #2781021.
  • Enhanced JavadocType check to handle and report on unknown Javadoc tags. The property allowUnknownTags can be set to ignore errors. (bug #2882261)

Notes:

  • Updated dependencies: Updated Google collections to version 1.0.
  • Updated documentation: Added links for 3rd party tools.

Release 5.0

Release 5.0 is not 100% backwardly compatible with release 4.4. Most likely you will need to update your configuration file.

The following checks were added since release 4.4:

Since release 4.4 the following checks were changed from a Check to a FileSetCheck:

This means that the checks above must not be declared under the TreeWalker module anymore. For example, the following Checkstyle 4.4 configuration file:

<module name="Checker">
  <module name="TreeWalker">
    <module name="Header">
      <property name="headerFile" value="${checkstyle.header.file}"/>
    </module>
  </module>
</module>
      

becomes the following Checkstyle 5.0 configuration file:

<module name="Checker">
  <module name="Header">
    <property name="headerFile" value="${checkstyle.header.file}"/>
    <property name="fileExtensions" value="java"/>
  </module>
</module>
      

The following checks were removed since release 4.4:

New Features since release 5.0 Beta 2:

Fixed Bugs since release 5.0 Beta 2:

  • RequireThis reported a violation when using an annotation with a member name that is the same as a member name in the enclosing class the annotation was used in (bug #2123003).

Release 5.0 Beta 2

Major change to FileSetCheck architecture to move the functionality of open/reporting of files into Checker. The advantages are:

  • Reduces the logic required in each implementation of FileSetCheck
  • Reduces, but not eliminates, the number of times a file is reported as being audited.
  • Reduces the amount of times a file needs to be read in from the file system.

The motivation for this change is to convert checks that are language neutral in nature, to be based on FileSetCheck. This allows the checks to be used for other languages apart from Java. As a practical example, it is possible to ensure that JSP and XML files do not contain tabs.

New Features:

  • Added the option charset to the header checks to allow controlling the encoding of the header file (rfe 1952641).
  • New check OuterTypeNumber for enforcing the maximum number of outer types per file. Inspired by patch #1145023 from Alexander Jesse.
  • Added the option sumTokenCounts to the DescendantToken to allow for even more powerful checks. For example, detect statements like this == null.
  • Add new options to the ImportOrderCheck to make it more flexible. Thanks to David Didier for providing patch #1854213.
  • New check FileTabCharacter for ensuring that any files does not contain a tab character. It replaces TabCharacterCheck which was restricted to Java files.
  • Changed FileLength check to be a FileSetCheck.
  • Changed RegexpHeader and Header to be a FileSetCheck. Removed CrossLanguageRegexpHeader as a result.
  • Enhanced JavadocStyle to check for allowed HTML tags. Thanks to Nicolas Dordet for providing patch #2214251.
  • Enhanced JavadocMethod to be more restrictive on where {@inheritDoc} can be used. Also enhanced JavadocPackage to ensure a package-info.java file contains a comment. Thanks to Travis Schneeberger for providing patch #2294029.
  • Added the SuppressWithNearbyCommentFilter filter that uses nearby comments to suppress audit events. Thanks to Mick Killianey for providing patch #2354424.
  • Added the new checks RegexpMultiline RegexpSingleline RegexpSinglelineJava.

Fixed Bugs:

  • The NCSS complexity checker reported an incorrect fileMax value (bug #2161419).
  • Checkstyle command-line no longer reports a usage error if the user specifies a directory with the -r option that does not contain any files. Thanks to Florian for patch #2151706.
  • Fixed the LeftCurly check to ignore leading annotations. Thanks to Tim Carpenter for patch #2506439.

Release 5.0 Beta 1

The 5.x release is developed using Java 5 and requires a Java 5 platform to run. If you need run a Java 1.4 or earlier, then use a Checkstyle 4.x release. As such, features for earlier versions of Java will be dropped over time.

New Features:

  • New check NoFinalizer for ensuring that a class does not define a finalize() method. Thanks to Feng Qian and Steve McKay for providing patch #1892273.
  • New check GenericWhitespace for ensuring the whitespace around the Generic tokens < and > are correct to the typical convention.
  • New check JavadocPackage for ensuring that each Java package has a Javadoc comment. Replaces the check PackageHtml which has been removed. (Bug 1228207)
  • Enhanced the JavadocMethod check to not require Javadoc if the method is tagged with the @Override annotation.
  • New check EqualsAvoidNull for ensuring that String literals is on the left side of an equals() comparison. Thanks to Travis Schneeberger for providing patch #1895152.
  • Overhaul of how the package names to be prefixed to module names are determined. See the documentation for full details. This has meant removing a supported parameter to the ANT task and the Command line. Thanks to Lars Koedderitzsch for patch #1914806.
  • New check AvoidStaticImport for ensuring there are no static import statements. Thanks to Travis Schneeberger for providing patch #1940611.
  • Enhanced the MethodName check to detect when a method name is the same as the residing class name. Thanks to Travis Schneeberger for providing patch #1892364.
  • New check NoClone for ensuring a class does not override the clone method from the Object class. Thanks to Travis Schneeberger for providing patch #1947417.
  • New checks ClassTypeParameterName and MethodTypeParameterName for type name formats. Thanks to Travis Schneeberger for providing patch #1956561.
  • Overhaul of how AbstractOptionCheck works. It now requires that the option type is a Java 5 Enum and hence the AbstractOption class has been removed.
  • Provide support in the module configuration to allow for custom messages that override the default message. This allows for messages to be easily overridden. See Custom Messages for more information. Thanks to Lars Koedderitzsch for providing patch #1917420.

Fixed Bugs:

  • Stop the WhitespaceAroundCheck from checking the Generic tokens < and >.
  • Fixed bug with incorrectly flagging an import as being unused. Bug 1860424, but as a consequence reintroduced bug 1098126. It is a catch-22 that both bugs can be solved with the current architecture.
  • Fixed bug #1649020 where generic parameters for methods recognized as HTML tags. Used patch #1936389 from Travis Schneeberger.

Notes:

  • Retired the J2EE Checks. If you are using Java 5, then you really should be using Java EE. If you need these checks, then use a Checkstyle 4.x release.
  • Applied patch #1892253 to expand access controls to other naming checks.
  • Applied patch #1993103 to make the format of end of sentence configurable in the JavadocStyle check.
  • Updated dependencies: Removed commons-collections; added Google collections (google-collect-snapshot-20080321.jar); upgraded commons-cli to version 1.1.
  • Changed the classes Scope and SeverityLevel to be based on the Java 5 Enum class. Used patch #2004776 from Travis Schneeberger.

Release 4.4

Fixed Bugs:

  • checkstyle-all.jar contained some classes from jakarta commons-collections twice. (bug 1630361)
  • Multiple string literal check now ignores annotations by default (bug 1560940). It is possible to retain the old behaviour by setting the new check property ignoreOccurrenceContext to an empty value.
  • The calculated value of NPath complexity was subject to integer overflow, so complex code was not always flagged (bug 1654769).
  • Fixed misleading documentation for BooleanExpressionComplexity check (bug 1579227).
  • Fixed Java parser error for array brackets in wildcard generic types (bug 1394014). Thanks to Paul Constantinides for submitting the fix (patch 1422247).
  • Fixed false alarm in HideUtilityClassConstructor check when class has only static methods but contains non static fields (bug 1762702).

New features:

  • Allow to control the operator token types in BooleanExpressionComplexity check (in response to bug 1579227).
  • Added an entry for Checkstyle-IDEA on the home page.
  • Set the failureProperty with a meaningful message (feature request 1725475).
  • Add a URL option for ImportControl check. Thanks to Benjamin Lerman for the patch 1724683.
  • Moved source control over to Subversion.

Release 4.3

Fixed Bugs:

  • The StrictDuplicateCode check didn't report correct results when multiple duplicate code regions were overlapping. (bug 1564465)
  • Fixed NPE in FallThrough check (bug 1472228)
  • Fixed typo in Command Line example (bug 1464595)
  • RegexpHeader check now correctly report problematic line in file with regexps for header (bug 1455575)
  • Fixed small problem in usage checks (patch 1498920). Thanks to Chris Povirk (cpovirk) for submitting the patch.
  • Fixed incorrect French translation (bug 1611403). Thanks to Fabien Bergeret for providing the correct value.

New features:

  • Major performance improvements in the StrictDuplicateCode check, especially for large projects. Also, false alarms are no longer possible.
  • New CrossLanguageRegexpHeader check that allows checking file headers for other languages than Java.
  • Applied patch 1586411 from Dennis Lundberg (dennislundberg) to add Maven POM files to the build.

Release 4.2

New features:

  • NoWhitespaceAfter check now accepts TYPECAST token to check is there is no whitespace after typecast. (rfe 1248106).
  • IllegalType can be configured to accept some abstract classes which matches to regexp of illegal type names (property legalAbstractClassNames, rfe 953266). Thanks to Paul Guyot (pguyot) for submitting patch.
  • TrailingComment now can be configured to accept some trailing comments (such as NOI18N) (property legalComment, rfe 1385344).
  • Added WriteTag check which outputs a JavaDoc tag as information (patch 902110) Thanks to Daniel Grenner (dgrenner) for contribution.
  • Support for suppressing audit events based on an identifier that is assigned to individual modules/checks. This allows for suppressing at a finer level than the check class name. See SuppressionFilter documentation for more.
  • Added the style sheet checkstyle-frames.xsl, thanks to Paul King. (Bug 1385095).
  • Applied patch (1505376) by Clint Stotesbery to support the suppressLoadErrors property for AbstractTypeAwareCheck (RFE 1491630).
  • Upgraded to ANTLR 2.7.6.
  • GUI now displays a TextArea with the contents of the file parsed. Based on patch from sermojohn (RFE 1499180).

Fixed Bugs:

  • First attempt to fix 1000092 (RightCurlyCheck misbehaves for LIT_CATCH). The check has been rewritten to check rcurly after finally and else. Current behavior is incompatible with previous one.
  • Fixed problem in type aware checks with loading inner-classes which were referenced as <outer_class_name>.<inner_class_name> (bug 1379666, modules JavadocMethod and RedundantThrows).
  • Fix UTF-8 encoding error in XMLLogger. (bug 1369589).
  • The new property logLoadErrors of the JavaDocMethod check now allows controlling the behaviour when checkstyle cannot load a class that is referenced in javadoc (bug 1422462).
  • Tighten up the allowed use of the {@inheritDoc} tag.
  • Stop creating duplicate regular expression patterns.

Release 4.1

Fixed Bugs:

  • Documentation for JavadocMethod check corrected to indicate that after fix for 1290379 javadoc which contains only @see tag is not valid any more (bug 1369615)
  • Fixed StackOverflowError in GenericIllegalRegexp check which may occur if ignoreComments is true and there is an illegal match in comment at the end of line. (bug 1371588)
  • InnerAssignment now ignores assignments in annotations. (bug 1369425)
  • Applied patch from Ralf (rakus) to remove javadoc's complaints. (patch 1352862)
  • Fixed StringIndexOutOfBoundsException which MethodParamPad may throws if someone tries to create object of generic class (with any params) (bug 1374792).
  • Added information to the manifest file. (bug 1380322).

Release 4.0

New features:

  • Applied patch 1344344 by sjq to provide the new Regexp check that can provide the functionality of the following checks: RegexpHeader
  • Added support for property ignoreStringsRegexp to MultipleStringLiterals check. Patch 1254918 from taab.
  • Added Spanish translation of messages. Thanks to Ricardo Mones (patch 1250329).
  • Made the Class Loader used to load infrastructure classes and resources come from Thread.currentThread() .getContextClassLoader(). Done as a result of patch 1273903 from Lars Koedderitzsch.
  • Added patch The LocalizedMessage already gets the Class of the check that triggers the message (to output the name of the check). Instead of storing just the name of this class, store the class itself. With this the name can be retrieved and the classloader of this class can be used to load the correct resource bundle. Patch 1309516 from Ralf (rakus).
  • FallThrough check now can check last case group (property checkLastCaseGroup, bug 1245942).
  • Applied patch 906531 (WhitespaceAround allows empty method/ctor bodies.) Thanks to Eric Roe (module WhitespaceAround, properties allowEmptyCtors and allowEmptyMethods).
  • FallThrough check can be configured to ignore fall-throughs if there is a relief comment, thanks to Ralf (aka rakus) for a great patch (rfe 1345691, patch 1348873)

Fixed Bugs:

  • Fixed encoding problems when parsing XML because was using FileReader instead of FileInputStream. Bug 1320132.
  • The InnerAssignment check didn't find all instances of inner assignments. Bug 1195047.
  • Fixed typo in grammar (bug 1335088)
  • Fixed ParenPad check problem which was caused by one of recent grammar change (one which was about (SUPER_)CTOR_CALL) (bug 1322879).
  • Fixed bug in logic JavadocStyle check uses to get main-section of javadoc (bug 1291847).
  • Three more fixes for Indentation check (bugs 1251988, 1260079, 1336737).
  • Fixed problem in Comment.hasIntersectionWithComment() (patch 1339523 from Richard Schulte).
  • Now javadoc method should not contain only @see tag (but could contain only {@ingeritDoc} tag) (bug 1290379, module JavadocMethod)

Other improvements:

  • Applied patch 1292684 from Maarten Coene to fix the generated HTML reports that are not correct if you include the TreeWalker and the StrictDuplicateCode modules in the same configuration. Patch effects checkstyle-noframes-sorted.xsl.
  • Applied patch 1340300 from David Dodini to update bcel checks to be compilable with current Checkstyle's API.
  • Added antlib.xml to support new cool feature of Ant.
  • Applied patch 1386388 to enable ConfigurationLoader to load from InputStream.

Release 4.0 Beta 6

New features:

  • One more change for grammar: now CTOR_CALL and SUPER_CTOR_CALL nodes represents "this" and "super" keywords from these statements.

Fixed Bugs:

  • Removed all reference to the usage checks (bug 1256662).
  • RequireThis now handles inner enums better (bug 1257599)
  • Fixed package name for modifiers checks in documentation (bug 1275988)
  • MagicNumber allows use numeric constants in enum constant definition (bug 1284682)
  • Fixed i18n problems in ArrayTypeStyle, HideUtilityClassConstructor and AvoidInlineConditionals(bug 1262825)

Other improvements:

  • TBD

Release 4.0 Beta 5

New features:

  • Added useFile property of ant task (patch 916971)
  • Documented new tokens which is checked by WhitespaceAround (bug 1233425)
  • Added patch (ID 1193251) to suppress processing of checks with 'ignore' severity. From Lars Koedderitzsch.
  • Added IllegalThrowsCheck to detect illegal throw declarations.
  • Added ImportControlCheck to controls what packages can be imported in each package. Useful for ensuring that application layering is not violated.

Fixed Bugs:

  • HiddenField can be configured to ignore parameters of abstract methods (property ignoreAbstractMethods, bug 1084512)
  • Applied patch 1079192 (thanks to Dave Brosius)
  • Two more bugs fixed in type aware checks (RedundantThrows and JavadocMethod checks) (bug 1168408 and 1220726)
  • Applied patch 1045127 (thanks to Paul Constantinides)
  • TypecastParenPad and ParenPad are now smarter in detecting if paren is part of typecast (bug 1217798)
  • LocalFinalVariable now also checks catch parameters (bug 1223290)
  • Applied patch 1061458, hope this helps users who use checkstyle with JRockit (thank to Ville Skytta for contribution)
  • Changed way how to IndentationCheck handles fields in classes and operator new (bug 1193848, 1232822)
  • Fixed problem with cache file (patch 1012389) thanks to Dave Wood.
  • Fixed example for FinalLocalVariable snf the check itself (bug 1241722)
  • Fixed implementation of DetailAST so getPreviousSibling() works for all nodes in AST tree (bug 1244994)
  • Now type-aware check know more about generics (bug 1249707, modules: RedundantThrows and JavadocMethodCheck)

Other improvements:

  • Introduced the EMMA code coverage tool. A report is produced as a result of running the unit tests.
  • Retired the usage checks to the contrib directory. If there is interest in the future they may be promoted back into the optional set of checks.

Release 4.0 Beta 4

Fixed Bugs:

  • Fix critical bug in the grammar (bug 1216844)

Release 4.0 Beta 3

Fixed Bugs:

  • DesignForExtension check skips enums now (they are final :). (bug# 1194470)
  • Indentation check now works better with enums and for-each statements (bugs 1193850 and 1193855)
  • Corrected calculation of Cyclomatic complexity metric (bug 1203536, module CyclomaticComplexity)
  • SuppressionCommentFilter now silently does nothing if there is no FileContentsHolder (bug 1183749)
  • Java Parser now understands Java 5 hex float syntax (bug 1195818)

Other improvements:

  • Improved performance of reading Java files (patch 1214386, contributed by Lars Koedderitzsch)

Dependencies:

  • Since Checkstyle now requires Java 1.4, it does not need Jakarta Regexp library any more and uses java.util.regex package from J2SE instead. The regular expression specifications of these libraries use a slightly different syntax in some corner cases, e.g. for posix character classes. We expect that these differences are not relevant for the majority of checkstyle users, but please check your configuration.

Release 4.0 Beta 2

Dependencies:

  • Checkstyle now requires Java 1.4, running Checkstyle inside a Java 1.3 VM is no longer supported.

Fixed Bugs:

  • The Ant task now always prints a summary line like 'Running Checkstyle 4.0 on 339 files' (bug 1099573).
  • Added missing documentation for the fileExtensions property of the NewlineAtEndOfFile check (bug 1174751).
  • Fixed bug #1098126 in UnusedImport check.
  • Fixed bug #1185722 (DeclarationCollector.leaveToken unbalanced with visitToken)
  • Fixed NPE in AbstractUsageCheck when we process an empty file (bug 1165855)

Release 4.0 Beta 1

New features:

  • Introduced preliminary support (beta quality) for the Java 5 language. Previous versions of Java are still supported so this release should be a drop in replacement for the 3.5 release. The reason for the beta release is to solicit feedback on the Java 5 support.
  • Documentation contains an alphabetically sorted list of all available checks.
  • Checker.getBasedir() is public now (rfe 1023004)
  • JavadocMethod check now can be configured to skip missed javadoc (rfe 1060634)
  • Some clarifications on scope property of javadoc checks added (rfe 1009201)
  • UnusedPrivateMethod check now can be configured to ignore serialization-related methods (readObject(), writeObject(), readResolve() and writeReplace()) (rfe 1036387)
  • Added support for the property allowMissingPropertyJavadoc on the JavadocMethod check.

Resolved bugs:

  • Fix bug with suppression filtering. (bug 1080343).
  • Improved French message translations (patch 1097980 by Olivier Parent).
  • Fixed typo in SuppressionCommentFilter which caused bug 1084654
  • Fixed 1048226 (Runtime problems of Checks are logged to checkstyle audit), now checkstyle will fail if it cannot load class for exception from throws clause of javadoc (modules RedundantThrows and JavadocMethod)
  • Fixed French translation, patch from Paul Guyot (bugs 1090381 and 1100946)
  • Fixed problem with exception's javadoc checks(bug 1100193, module JavadocMethod)
  • Fixed two more problems in Indentation check (bug 1089128)
  • ConstantName check now exclude serialPersistentFields from the check (bug 1097285)
  • One more problem with SuppressionCommentFilter fixed (bug 1061459)
  • format property of IllegalType check documented (bug 1047449)
  • ModifiedControlVariable check changed to work with for-each correctly (1101851)
  • Annotations and enums are classes too and should be treated so by ClassFanOutComplexity checks (bug 1109205)
  • Two more annotation-related problems (module Indentation, bug 1109214 and module UnnecessaryParentheses, bug 1109238)

Other changes:

  • Added new check packages and moved check implementations. Users who maintain their own packagelist must adapt to these changes.

Release 3.5

New features:

  • Added attributes maxErrors and maxWarnings to Ant task to allow finetuning of failure behaviour (request 783538).
  • Added check that checks for a required regexp, contributed by Daniel Grenner (module RequiredRegexp, request 606115, patch 902189).
  • Added check for the ncss metric. (module JavaNCSS, patch 920820)
  • Added check that checks for multiple string literals, contributed by Daniel Grenner (module MultipleStringLiterals, patch 929882).
  • Added check that checks for a modified control variable in a for loop, contributed by Daniel Grenner (module ModifiedControlVariable, patch 927680).
  • Added example of how to configure the XML parser factory for Checkstyle, and how to support XInclude processing (contrib/examples/XInclude, request 905169).
  • Added example of an ant build file and stylesheet for generation of an HTML error report with links to source code.
  • Added filter that suppresses audit events according to source file comments, contributed by Mike McMahon (module SuppressionCommentFilter, requests 732196 and 931327).
  • Better information for unexpected char (request 666188).
  • Added charset property to TreeWalker and StrictDuplicateCode check (addresses bug 975346).
  • French message translations, contributed by Pierre Dittgen (request 978916).
  • DataAbstractionCoupling reports coupling classes, contributed by Benoit Xhenseval (request 990055).
  • FinalLocalVariable ignores parameters of interface methods and abstract methods. (request 993922 and bug 1002849).
  • Header and RegexpHeader checks allow header specification directly in the checkstyle configuration file, not only in an external file (request 1041590).
  • com.puppycrawl.tools.checkstyle.gui.Main accepts an optional file name in the command line. (request 1000102).

Resolved bugs:

  • False alarms from UnusedPrivateMethodCheck for anonymous inner class parameter. (bug 950548).
  • Fixed bug in handling imports in RequireThis(bug 952508)
  • JUnitTestCaseCheck erroneously mentions tearDown instead of setUp. (bug 955925, patch by Paul Guyot)
  • JavadocTypeCheck does not find a tag on the first comment line. (patch 959995, patch by Michael Tamm)
  • StrictDuplicateCodeCheck did not find duplicates within the same file.
  • Unexpected char (bug 975346).
  • MagicNumber check overly aggressive (reported on user mailing list).
  • Documentation error for naming convention checks (bug 987503).
  • FinalParametersCheck checks parameters of abstract methods. (bug 1002849).
  • Bug in ClassResolver where it was mismatching imports - example would match SecurityDataException when looking for DataException. Bug was visible in RedundantThrows check (no known bug).
  • Fixed HiddenFieldCheck to correctly handle static inner classes (bug 1032426).
  • Fixed misspelling of variable (patch 1032618 contributed by Paul Wagland).
  • Fixed ClassResolver to handle exceptions which are inner for current class (bug 945149).
  • Fixed ClassResolver to handle fully-qualified inner classes (bug 1037667).
  • Fixed 1033166 (Indent module specifies two indent levels for one line)
  • Fixed false alarms in RequireThis check (bug 952508)

API changes:

  • Added new class SeverityLevelCounter.

Release 3.4

New features:

  • Added a 'version' attribute to the 'checkstyle' element in the XML output document (request 853128).
  • FinalParameter can be applied to catch blocks (request 848820).
  • Improved German translation, contributed by Oliver Fischer (patch 862911).
  • Added stylesheet to translate XML output into comma separated values format (contrib/checkstyle-csv.xsl, request 764153).
  • Added BooleanExpressionComplexity check from Simon Harris (request 750760)
  • Added ClassDataAbstractionCoupling check from Simon Harris (request 750758)
  • Added ClassFanOutComplexity check from Simon Harris (request 750759)
  • Added NPathComplexity check from Simon Harris (request 750757)
  • Added several more log() methods to AbstractViolationReporter. (request 843551)
  • Added check to ensure that default is a last label in the switch statement.(module DefaultComesLast, request 754486 )
  • Added check to ensure that all classes define constructor. (module MissingCtor, request 696129)
  • Added check to warn on fall-through in case with code not followed by break. (module FallThrough, request 754438)
  • Added check to ensure that every variable is declared in its own statement and on its own line (module MultipleVariableDeclarations, requests 639233, 753858, 844705)
  • Added check to ensure that references to non-static fields and methods should be qualified. (module RequireThis, contributed by Stephen Bloch, requests 755550, 696295).
  • Added multiLines property to regexpCheck (request 597676)
  • Added check for the padding between the identifier of a method definition, constructor definition, method call, or constructor invocation; and the left parenthesis of the parameter list. (module MethodParamPad, request 843254)
  • Added check to forbid endline comments. (module TrailingComment, request 744970)
  • Added applyTo(Public|Protected|Package|Private) properties to check MemberName. (request 695935)
  • Added check to verify padding in empty for loop initializers. (module EmptyForInitializerPad, part of fix for bug 895072)
  • Added checkEmptyJavadoc property to JavadocStyle check, contributed by Daniel Grenner (request 849056, patch 903597)
  • Added format property to ReturnCount check to configure ignored method names (request 904437)
  • Added attribute 'default' to configuration <property> tags, improves usability for centralized configuration files. This change triggered a new version of the configuration DTD. Your old configuration files will still work, but if you want to use the new 'default' attribute you need to upgrade your configuration file to DTD version 1.2.
  • Ignore comments in GenericIllegalRegexp check, contributed by Daniel Grenner (request 680988, patch 902109).
  • UnnecessaryParentheses check contributed by Eric Roe (patch 911086, request 634834)
  • Added ignoreNonLocal property to UnusedParameter check to check only private and static methods (request 787683)
  • Added excludeScope property to Javadoc(Method|Variable|Type|Style) checks (request 846108)

Resolved bugs:

  • Incorrect documentation of cmdline options (bug 865610).
  • FinalParameter now reports column of start of parameter declaration. (bug 864900)
  • Fixed inconsistent handling of NLOW (new line on wrap) option by LeftCurly check. (bug 866501)
  • JDK 1.4 classes used by usage checks. (bug 876570)
  • Error in reporting UnusedLocalVariable for multi-dimensional array index. (bug 878608)
  • MagicNumberCheck throws NumberFormatException with negative octal and hex ints and longs.
  • JavadocStyleCheck throws StringIndexOutOfBoundsException when open tag character, <, is the last character on a line.
  • UnusedPrivateMethod false positive (ternary call). (bug 880954)
  • Cast causes MagicNumberCheck error. (bug 890706)
  • Conflict between ParenPad and NoWhiteSpaceBefore when code uses empty for loop initializers. (bug 895072)
  • Fixed JavadocStyleCheck to handle inline javadoc tags correctly (bug 897749)
  • Updated documentation for ReturnCount check to reflect that it doesn't check equals() method (bug 904443)
  • Erroneous UnusedPrivateField error when the left operand is enclosed in parentheses and the field is in the right operand (bug 908339)
  • ExplicitInitialization shouldn't report about explicitly initialized member of interface (bug 909619)
  • DesignForExtension fires for private inner classes (bug 884035).
  • Entity resolver for configuration files now handles all previous versions of the configuration DTD locally, without accessing the internet (bug 909987).
  • Fixed handling of imports for inner classes in RedundantThrows (bug 925263)

Removed features:

  • Removed ignoreLines property of RegexpHeader check. To make some line optional use "^.*$" regexp for this line.
  • Fixing bug 895072 required changing the logic of the NoWhiteSpaceBefore and ParenPad checks. When a for loop has an empty initializer (like for (; i < j; i++)) both checks will not check whitespace between the opening parenthesis and the first semicolon any more. To enforce your coding rules for such code, you need to use the EmptyForInitializerPad check.

API changes:

  • Added programmatic access to token type documentation (request 724871)
  • All comments are wrapped in TextBlocks (request 885993).

Release 3.3

Distribution:

  • Renamed checkstyle-version-optional.jar to checkstyle-optional-version.jar to make the distribution Maven friendly.

New features:

  • Fixed grammar build process (request 827781).
  • Added caseSensitive property to ImportOrder check (bug 842604).
  • Added classpathref property to ant task (patch 835896, from Ville Skytta (scop)).

Resolved bugs:

  • Removed MutableException dependency from 1.4 API.(bug 842756)
  • j2ee.EntityBean check for constructor is incorrect (bug 846110).
  • Fixed ArrayIndexOutOfBounds in JavaStyle (bug 841942).
  • Fixed 8433887 - XHTML not handled correctly in JavadocStyle.
  • Fixed ArrayTypeStyle error when type declaration and variable/method name are placed on different lines (bug 848750).
  • Fixed several typos in documentation (patch 848483 from Ville Skytta (scop)).
  • xmllogger.dtd is out-of-date (bug 847974).
  • ArrayTypeStyle shouldn't check method definition (bug 849450).
  • Added link to summary page in checkstyle-frames.xsl (bug 852397).
  • Fixed bug #791245: checkstyle-frames.xsl cannot handle multiple leafs.
  • Fixed handling of inheritDoc in JavadocMethod check (bug 855839).
  • Fixed bug #853225 - Indentation gives false errors.
  • Wrong documentation for FinalLocalVariable (bug 860990).

Release 3.2

Distribution:

  • Checks that are designed to be used for a special class of applications (like J2EE) or that require external libraries are now distributed in a separate jar file. This is similar to the way the Ant distribution is organized.
  • Updated Jakarta Regexp library to version 1.3.

New features:

  • Added ability for user to incorporate custom listeners (requests 738205, 738388). Example listeners perform verbose and Commons Logging audits (request 737584).
  • Added JavadocStyle check to ensure they are stylistically well formed. Nice patch from Chris Stillwell.
  • Added check for trailing comma in array initialization (module ArrayTrailingComma, request 696301).
  • MagicNumberCheck now checks array initializers (request 745949).
  • Added check for uncommented main methods (debugging leftovers). (module UncommentedMain, request 732257)
  • Added check to enforce that anonymous inner classes do not exceed a certain length (module AnonInnerLength, request 715709, contributed by Rob Worth).
  • Added TypecastParenPadCheck to check the padding of typecasts (bug 750348).
  • Added ignoreFormat property to HiddenFieldCheck (request 748830).
  • Nice patch from Matt Quail to DetailAST to replace all the repeated int[] array construction with a BitSet.
  • Patch from Matt Quail to stop the ugly hack of having hard coded constants in TokenTypes. The big risk was that when the grammar changed, the generated constants could change (patch 757846).
  • Added excludes property to AvoidStarImport, contributed by Bill Schneider (request 744955).
  • Added CyclomaticComplexityCheck from Simon Harris.
  • Added check to catch equality comparison with string literals using the == operator (module StringLiteralEquality, request 754835).
  • Added check for definition of covariant equals() method without overriding method equals(comp.lang.Object) (module coding.CovariantEquals).
  • Added NestedTryDepthCheck and NestedIfDepthCheck from Simon Harris (requests 750736 and 750744).
  • Added IllegalTokenCheck from Simon Harris (request 750755).
  • Added allowInSwitchCase property to AvoidNestedBlocksCheck to allow limiting the scope of variables to one case of a switch statement.
  • Added checks for J2EE requirements.
  • Added a check that an overriding clone() method invokes super.clone().
  • Added a check that an overriding finalize() method invokes super.finalize().
  • Added usage checks OneMethodPrivateFieldCheck, UnusedLocalVariableCheck, UnusedParameterCheck, UnusedPrivateFieldCheck, UnusedPrivateMethodCheck.
  • Added filters for audit events (partially fulfills request 559103). A SuppressionFilter denies events according to a suppressions file (request 756416).
  • Made basedir property of Checker OS agnostic (request 663149).
  • Enhanced RedundantModifier to check that all private methods and all methods in a final class do not contain modifier final (discussed in request 775011).
  • Added MethodLengthCheck option for counting empty and comment lines (requests 589358 and 654039).
  • Added a check for illegal token text (requests 740694 and 750633).
  • Added property to HiddenFieldCheck to ignore the parameter of property setter methods (request 790456).
  • Added DescendantToken check (request 755021).
  • Added IllegalCatch check from Simon Harris (request 750746).
  • Added PackageDeclaration check from Simon Harris (request 750753).
  • Added JUnitTestCase check from Simon Harris (request 750761).
  • Added MutableException check from Simon Harris (request 750750).
  • Added AbstractClassName check from Simon Harris (request 750749).
  • Added ThrowsCount check from Simon Harris (request 750742).
  • Added ReturnCount check from Simon Harris (request 750745).
  • Added CyclomaticComplexity check from Simon Harris (request 750756).
  • Added ExecutableStatementCount check from Simon Harris (request 750751).
  • Added property to HiddenFieldCheck to ignore constructor parameters (request 798240).
  • Added check for illegal type of variable, parameters and return value of methods contributed by Simon Harris (request 750739, module IllegalType)
  • Added check for correct declarations order contributed by Roland Auckenthaler (module DeclarationOrder)
  • Added ParameterAssignment check contributed by Simon Harris (request 750748).
  • Added FinalLocalVariable check from Roland Auckenthaler and Kevin Gibbs.
  • Added check for correct grouping/order of imports from Bill Schneider (module ImportOrder, request 745548)
  • Added Indentation check from John Richardson (request 493366)
  • Added check for explicit initialization class and object variable to value which is default for variable's type (module ExplicitInitialization, request 614387).
  • Added check to find duplicate code (module StrictDuplicateCode, request 650710).

Resolved bugs:

  • Fixed NPE when running ArrayTypeStyle check (bug 744573)
  • Typo in HideUtilityClassConstructor description (bug 743973)
  • False MagicNumberCheck errors for interfaces (bug 745941)
  • Docs for severity (bug 745937)
  • EmptyBlock does not accept stmt option (bug 747400)
  • Inner class fields interpreted as local variables (bug 747530)
  • Fixed typo in documentation for PackageName (bug 7480028)
  • NumberFormatException in MagicNumberCheck (bug 748913)
  • Removed broken support for checking typecasts from ParenPadCheck (bug 750348)
  • Fixed grammar problems with unclosed string literals and multiple-lines comments (bug 694111)
  • Fixed grammar definition for identifiers to handle all Unicode symbols (bug 755744)
  • Corrected misspelling of "precede" (bug 744342)
  • EmptyForIteratorPadCheck errors when for statement wraps at the iterator (bug 777471)
  • False alarms from IllegalInstantiation for user defined classes with the same names as those in java.lang (bug 772832)
  • NoSuchElementException in JavadocStyleCheck (bug 785514)
  • RedundantModifierCheck error for public modifier of a method defined in an inner implementation (bug 784814)
  • MagicNumberCheck does not permits negative constants (bug 788106)
  • NullPointerException in Unused... checks (bug 787672)
  • NoSuchMethodError when line wrapped at dot operator (bug 790209)
  • Removed finder restrictions of LocalHomeInterfaceCheck and RemoteHomeInterfaceCheck (bug 791591)
  • Fixed NoSuchMethodError when line wrapped at dot operator (bugid 790209)
  • Incorrect usage checks documentation (bug 790457)
  • CyclomaticComplexityCheck not documented in docs (bug 783800)
  • Changed configuration documentation example from checkstyle_checks.xml to sun_checks.xml (see bug 750169)
  • JavadocStyleCheck doesn't accept {@inheritDoc} javadoc (bug 798405)
  • Unused local variables are not always detected (bug 798111)
  • Fixed allowThrowsTagsForSubclasses/allowMissingThrowsTag interfere (bug 803577)
  • Unused... checks don't work together (bug 805954)
  • NoWhitespaceBeforeCheck error with an interface (bug 806242)
  • NoWhitespaceBeforeCheck error for anonymous inner class (bug 806243)
  • Usage of optional checks should be documented (bug 806961)
  • Changed default format for ConstantName to ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ to please regexp library (see bug 807571)
  • HiddenFieldCheck error for a local variable of a static method with same name as an instance field (bug 827713)
  • Changed HideUtilityClassConstructorCheck behaviour for classes that do not extend java.lang.Object directly (partial fix for bug 824754)
  • False alarms for abstract classes from FinalClass (bug 837012)
  • Added Checker.removeListener() (fix for 834367)

API changes (only relevant for IDE plugin authors):

  • AuditListener and AuditEvent have been moved from package com.puppycrawl.tools.checkstyle to package com.puppycrawl.tools.checkstyle.api.

Release 3.1

New features:

  • Patch from David Schneider to have severity levels for each check (request 597683).
  • Added check to avoid inline conditionals like "b ? x : y" (module AvoidInlineConditionals, request 597790).
  • Added check that blocks are not introduced at arbitrary places but only for if, while, etc. (module AvoidNestedBlocks, request 632442).
  • Added check to enforce that utility classes (classes that have only static methods) cannot be instantiated (module HideUtilityClassConstructor, request 634838).
  • Added check to enforce an API design that shields classes against bugs in derived classes (module DesignForExtension, request 659715).
  • Added check to enforce that Interfaces do not contain only constants (module InterfaceIsType, request 659717, see [Bloch, Effective Java], Item 17 "Use interfaces only to define types").
  • Added check to detect the double-checked locking idiom (module DoubleCheckedLocking, request 709333).
  • Added check to enforce C style (char c[]) or Java style (char[] c) for array type declaration (module ArrayTypeStyle, request 493380).
  • Added check to enforce that method parameters are final (module FinalParameters, request 528196).
  • Added module to enforce that files end with a newline character, contributed by Christopher Lenz (module NewLineAtEndOfFile, request 662544).
  • Many documentation improvements, contributed by Peter Dobratz.
  • Patch from Simon Kitching to allow more configuration control over the JavadocMethodCheck.
  • Checkstyle ant task outputs version info in verbose and debug mode (request 550483).
  • Patch from Oleg Sukhodolsky to add FinalCheck to check that classes are declared final if they only contain private constructors (request 696290).
  • Patch from Oleg Sukhodolsky to add MissingSwitchDefaultCheck to check that a switch statement has a default clause (request 564199).
  • Patch from Oleg Sukhodolsky to fix TranslationCheck Test bug. (bug 720925).
  • Patch from Oleg Sukhodolsky to fix documentation. (bug 727896).
  • Added check to find empty statements (module EmptyStatement, request 724573).
  • Added check to find magic numbers (module MagicNumber, request 564206).
  • One more option for JavadocMethodCheck (allowThrowsTagsForSubclasses, request 540383)
  • Added sourceName property to AuditEvent and LocalizedMessage; and "source" attribute to "error" element of XMLLogger output (request 686336).
  • Added line and column numbers to configuration parse exceptions (request 714962).
  • Added check for redundant exceptions in throws clause (module RedundantThrows, request 579056)
  • Added property for GenericIllegalRegexp to customize reported message (module GenericIllegalRegexp, property message, request 738567)
  • Moved the location of the file checkstyle_packages.xml to be in the directory com/puppycrawl/tools/checkstyle. This is to work around a bug in NetBeans (request 739881).
  • Patch from Dale King to enhance the GUI with a Reload Java File button and storage of the current directory of the last opened file (request 740545).
  • Patch from Bill Schneider to add GenericIllegalRegexpCheck property to perform case-insensitive matches (request 740112).

Resolved bugs:

  • False alarms from RightCurly module for code that does not have braces in if-then-else (bug 689836).
  • Grammar incorrectly defaulting unqualified floating point literals to be float, when they should be double (bug 713716).
  • "threadsafe" was treated as a Java keyword, resulting in parser errors for sources that use it as an identifier (bug 710319).
  • ConfigurationLoader was not public (only relevant for IDE plugin authors).
  • HTML syntax errors in documentation (bug 721458).
  • Error when writing a DOS file name from checkstyle-frames.xsl (bug 713845).
  • Files were not being closed by Utils.getLines().
  • Missing documentation for the EmptyForIterator check (bug 740038).

Development Team:

  • Oleg Sukhodolsky has joined the team.

Release 3.0

New features:

  • Completely new architecture based around pluggable modules. This means that users can now write their own checks without changing the source code of checkstyle itself (request 578712).
  • Users can specify the Java token types for which a check must be performed. For example users can now control that there should be whitespace after 'synchronized' but not after 'if' (request 536385).
  • Detect classes that override 'equals()' but not 'hashCode()' (request 554373).
  • Detect inner assignments, e.g. 'this.add(label = new JLabel("yes, I'm a C hacker"));' (request 521325).
  • Detect matches of generic regular expressions (requests 595254, 621247, 630536).
  • Find empty blocks (not only empty catch blocks, request 609523).
  • Check spaces at empty for iterators (requests 565666, 583725).
  • Detect missing property file keys in internationalized applications (request 634966).
  • Check content of @author and @version tag against a regular expression.
  • Detect hiding of fields by parameters or local variables with the same name (request 471897).
  • Detect obsolete final modifier in interfaces (request 651121).
  • Detect whitespace before ';' (request 521323).
  • Added DTD for XML output (request 622157).
  • Added an XSL stylesheet to convert XML output to plain text, contributed by Jon Scott Stevens.
  • Added a Portuguese localization, contributed by Pedro Morais.
  • Added a Finnish localization, contributed by Ville Skyttä.
  • Added a French localization, contributed by Pierre Dittgen.

Resolved bugs:

  • Fully-qualified @throws claimed unused (bug 658805).
  • Expected @return tag when one is there (bug 579190).
  • Package name reported incorrectly (bug 622290).
  • Empty header filename silently ignored (bug 629139).
  • Array instantiation incorrectly flagged (bug 626875).
  • Tests fail with non-English locale (bug 594469).
  • Cachefile streams were not closed (bug 665016).
  • Ant Task: NullPointerException when type was not specified in formatter (bug 670321).

Removed features:

  • Removed support for Japanese localization until we find a new maintainer.

API changes (only relevant for IDE plugin authors):

  • Configuration is not based on Properties any more. Instead a Configuration interface is used, IDE plugins can define their own way of creating Configurations or they can reuse the provided ConfigurationLoader to read checkstyle's standard XML config files.

Development Team:

  • Rick Giles has joined the team.

Release 2.4

New features:

  • Major refactoring on the way Checkstyle is configured. It is now completely based around properties. Big thanks to Vincent Massol for the suggestion on how to refactor the ANT task (bug 605141).
  • Check the package name against a pattern (request 597787). Patch provided by Simon Langford.
  • Detect the number of parameters in a declaration exceeding a specified amount (request 582144).
  • Inspired by patch 580410 from Shinya Ohnuma, now the error messages are localised.
  • Support checking to determine if an unused @throws exception is a subclass of java.lang.Error (request 583719).
  • Incorporate patch 555878 from Rick Giles to allow pattern for local final variables to be specified.
  • Incorporate patch 566855 from Rob Worth to optionally check that parenthesis are padded with spaces.
  • Incorporate patch 590931 from Vijay Aravamudhan to improve documentation of the build.xml file.
  • Incorporate patch from Vijay Aravamudhan to enforce requiring @version tag (request 543964).
  • Incorporate patch 607481 from Ville Skyttä to enforce wrap on operator at EOL.

Resolved bugs:

  • Incorporate a patch from Ronald Hastings (Boeing) to correctly handle C++ style comments being between Javadoc comments and declarations.

API changes (only relevant for IDE plugin authors):

  • Many changes to the Configuration object.

Release 2.3

New features:

  • Support checking to determine if an unused @throws exception is a subclass of java.lang.RuntimeException (request 540382).
  • Detect instantiations of classes that should not be instantiated (e.g. java.lang.Boolean) (request 550205).
  • Added ability to specify the base directory for reporting file names (request 571161).
  • Check for line wrapping on operators (request 553160).
  • Detect empty try blocks.
  • Detect empty catch blocks (request 516255).
  • Detect empty finally blocks.
  • Detect to-do comments (request 504275).
  • Detect use of lowercase l ("ell") in long integer literals.
  • Include column number in the XML output (request 555262).
  • Added ability to specify a properties file on the command line (request 557544).
  • Check for whitespace around "{" and "}" (request 557544).
  • Fix Javadoc errors under JDK 1.4 (request 568553).
  • Detect redundant abstract modifier in interfaces (request 573485).
  • Support running Checkstyle using the -jar option.

Resolved bugs:

  • Better error reporting for missing properties files (bug 576165).
  • Ant task now logs style violations as errors (bug 561616).

API changes (only relevant for IDE plugin authors):

  • The get/setOutputStream methods have been removed from the AuditListener interface. The XMLLogger and DefaultLogger implementations now expect OutputStreams to be provided as a constructor argument.
  • The DefaultLogger now differentiates between info messages ("started checking file ...", etc.) and error messages (style errors found by checkstyle).

Release 2.2

Resolved bugs:

  • The cache was not invalidated upon parameter change (Bug 522282).
  • Tabs were not counted correctly in line length checks (Bug 524671).
  • Problem when a Checker could not be created (Bug 528358).
  • The documentation of the command line property names did not list the property checkstyle.allow.tabs (Bug 529975).
  • The default regular expression for constant names allowed consecutive '_' characters to occur (Bug 540358).
  • Checkstyle reported unused @throws tag for multiple declarations of the same Exception. According to the Java BugParade this is incorrect, multiple @throws tags for the same exception are OK (Bug 540384).

New features:

  • added check for whitespace around '()'
  • added support for JDK 1.4 assert statements
  • added column number to error messages for better Emacs integration
  • added possibility to disable line-length checking by means of regular expressions
  • added possibility to disallow import of package hierarchies, e.g. sun.*
  • added failureProperty to ANT task
  • added check for 'public' modifier in interface method declarations, following the recommendation in chapter 9.4 of the Java Language Specification
  • added -r "dir" option to the commandline frontend, checkstyle will find all Java files contained in the specified directory
  • incorporated patch from Warner Onstine to configure the ANT task by means of a property file
  • added 'contrib' directory, contains XSL stylesheets for formatting checkstyle's XML output (contributions by Ingmar Stein, Stephane Bailliez, Scott McCrory and Gray Herter)

Release 2.1

New features:

  • added check for package.html
  • added flag allowPackage which acts similar as allowProtected
  • added support for ignoring multiple lines in the file header
  • added support for specifying the file header by means of regular expressions
  • added whitespace checks around '.', e.g. System . out . println()
  • added check for names of methods and local variables
  • check the order of modifiers (public, static, etc.) against the recommendation in the Java Language specification
  • added checks for curly braces placement
  • incorporated patch from Andrew Lang for more robust Javadoc parsing

Release 2.0

Changes:

  • Now released under the GNU Lesser General Public License (LGPL).
  • Fix bug #508010, documentation and code are inconsistent.
  • Changes to make it build "out of the box".