Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.sf.alchim.codeplus.spoonchecker;
 
Report warnings when empty catch blocks are found.
 
 public class EmptyCatchAnalyzer extends AbstractAnalyzer<CtCatch> {
 
    @Override
    public void analyze(CtCatch element) {
        if (element.getBody().getStatements().size() == 0) {
            report(element"empty catch clause");
        }
    }
New to GrepCode? Check out our FAQ X