Miscellaneous Checks

To-do comments

The property checkstyle.pattern.todo specifies the pattern to match for to-do comments. The property type is regular expression and defaults to TODO:.

Tip

Using to-do comments is a great way to keep track of tasks that need to be done. By having them reported by Checkstyle makes it very hard to forget about them.

Integer Literals

The property checkstyle.ignore.longell specifies whether to not require that long integer literals use an uppercase L. For example 40L instead of 40l. This is in accordance to the Java Language Specification, Section 3.10.1. The property type is boolean and defaults to false.

illegal Instantiations

The property checkstyle.illegal.instantiations contains the set of classes that should not be instantiated directly. The property type is string set and defaults to an empty set.

Tip

A common mistake is to create new instances of java.lang.Boolean instead of using the constants TRUE and FALSE or the Boolean.valueOf() factory methods. This increases the program's memory requirements and wastes CPU cycles during memory allocation and garbage collection.

To find this error automatically, include java.lang.Boolean in the list of illegal instantiations.


Copyright © 2002 Oliver Burn. All rights Reserved.