Jtest logo




Contents  Previous  Next  Index

PB.AECB


Avoid "catch" blocks with empty bodies

Description

This rule flags any "catch" block that has an empty body.

It is always a good idea to insert error handling code inside of each "catch" block.

Example

 package PB;
 public class AECB {
     public void openFile (String s) {
         try {
         } catch (Exception e) {
            // nothing is done for this exception.
         }
     }
 }

Repair

Add exception handling code inside of the "catch" block.


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft