Performing static analysis of java code on a regular basis is an extremely useful exercise, and I’ve found “FindBugs” to be an extremely useful and worthy tool. One particular warning raised by it is “exception is caught, when exception is not thrown” – may appear to be a false positive at first, however, the tool basically recommends catching specific exception types, instead of haging a “catch all” exception clause that catches the base exception; this will mask potential programming mistakes. Catching specific exceptions and handling them appropriately – and perhaps differently makes for a better error-handling approach. Overall, it improves the readability of the code where others are able to better understand and extend the exception handling mechanism.
Try it out and fix the bugs before the customer spots it!