I've been using findbugs to track down issues in the code. I've got 89
issues remaining. I'm looking for feedback on three of the classes of
issues.
One is using the + operator for string concatenation in loops. These
probably should be StringBuffers, as this would eliminate the creation
of several temp objects. Any objections to moving to this? There are 12
of those.
The other class has to do with mutable fields being exposed. There are
30 of these. The biggest group of those are all of the public/protected
static final String[]. The final protects the reference of the array
that the variable points to, but does not protect the contents of the
array. Anything that can get its hands on the reference can change the
contents. I think these should also be fixed, but that would require
using getters instead of the direct reference to the array. There are
some get and set issues I can take care of easily enough as well.
It is also concerned about all of the catching of Exception:
Exception is caught when Exception is not thrown
This method uses a try-catch block that catches Exception objects, but
Exception is not thrown within the try block, and RuntimeException is
not explicitly caught. It is a common bug pattern to say try { ... }
catch (Exception e) { something } as a shorthand for catching a number
of types of exception each of whose catch blocks is identical, but this
construct also accidentally catches RuntimeException as well, masking
potential bugs.
Anyone have any feelings on these issues?
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]