EmptyTryBlock

Avoid empty try blocks - what's the point?

This rule is defined by the following XPath expression:


//TryStatement/Block[1][count(*) = 0]

              

Example:

                
  
public class Foo {
 public void bar() {
  try {
  } catch (Exception e) {
    e.printStackTrace();
  }
 }
}