Bill Pugh of the University of Maryland has released
FindBugs
1.3.1, an automated open source tool for finding potential
bugs in Java code. New rules in this release include:
- VA_FORMAT_STRING_ARG_MISMATCH:
A format-string method with a variable number of arguments is called,
but the number of arguments passed does not match with the number of
% placeholders in the format string. This is probably not what the
author intended.
- IO_APPENDING_TO_OBJECT_OUTPUT_STREAM:
This code opens a file in append mode and that wraps the result in an object output stream.
This won't allow you to append to an existing object output stream stored in a file. If you want to be
able to append to an object output stream, you need to keep the object output stream open.
The only situation in which opening a file in append mode and the writing an object output stream
could work is if on reading the file you plan to open it in random access mode and seek to the byte offset
where the append started.
- NP_BOOLEAN_RETURN_NULL:
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen.
This method can be invoked as though it returned a value of type boolean, and
the compiler will insert automatic unboxing of the Boolean value. If a null value is returned,
this will result in a NullPointerException.