![JAR search and dependency download from the Maven repository](/logo.png)
spoon.examples.analysis.processing.CatchProcessor Maven / Gradle / Ivy
The newest version!
package spoon.examples.analysis.processing;
import spoon.processing.AbstractProcessor;
import spoon.processing.Severity;
import spoon.reflect.code.CtCatch;
/**
* Reports warnings when empty catch blocks are found.
*/
public class CatchProcessor extends AbstractProcessor {
public void process(CtCatch element) {
if (element.getBody().getStatements().size() == 0) {
getFactory().getEnvironment().report(this, Severity.WARNING,
element, "empty catch clause");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy