Java News from Thursday, February 23, 2006

David Hovemeyer and Bill Pugh have posted FindBugs 0.9.5, an automated open source tool for finding potential bugs in Java code. New detectors in this release include:

I tested this out on XOM. Almost all the bugs it found were false positives, though it did find one place where I could change catch (Exception ex) to several more specific catch clauses for individual runtime exceptions. That's not really a bug, but it is a good idea. Hmm, on further experiment it seems I can remove the try-catch block completely. That means either:

A. I don't need it.

or

B. There's a missing test case somewhere.

It looks like Clover had noted this too. I'll have to investigate further. It found similar issues in a couple of other classes. If I hadn't used this tool frequently in the past, it would have found more.