Checkstyle Release Notes

Checkstyle Logo

Checkstyle 2

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 formating 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".