Code I/O

A topnotch site

Find bugs before your customer does …

Leave a comment

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!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s