diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ErrorRethrownInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ErrorRethrownInspection.java index 793ad82b4e2f..2310d5380405 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ErrorRethrownInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ErrorRethrownInspection.java @@ -51,20 +51,13 @@ public class ErrorRethrownInspection extends BaseInspection { private static class ErrorRethrownVisitor extends BaseInspectionVisitor { @Override - public void visitTryStatement(@NotNull PsiTryStatement statement) { - super.visitTryStatement(statement); - final PsiCatchSection[] catchSections = statement.getCatchSections(); - for (PsiCatchSection catchSection : catchSections) { - checkCatchSection(catchSection); - } - } - - private void checkCatchSection(PsiCatchSection catchSection) { - final PsiParameter parameter = catchSection.getParameter(); + public void visitCatchSection(PsiCatchSection section) { + super.visitCatchSection(section); + final PsiParameter parameter = section.getParameter(); if (parameter == null) { return; } - final PsiCodeBlock catchBlock = catchSection.getCatchBlock(); + final PsiCodeBlock catchBlock = section.getCatchBlock(); if (catchBlock == null) { return; } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ThreadDeathRethrownInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ThreadDeathRethrownInspection.java index a79b5b2f9e73..130ace79f489 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ThreadDeathRethrownInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/ThreadDeathRethrownInspection.java @@ -51,20 +51,13 @@ public class ThreadDeathRethrownInspection extends BaseInspection { private static class ThreadDeathRethrownVisitor extends BaseInspectionVisitor { @Override - public void visitTryStatement(@NotNull PsiTryStatement statement) { - super.visitTryStatement(statement); - final PsiCatchSection[] catchSections = statement.getCatchSections(); - for (PsiCatchSection catchSection : catchSections) { - checkCatchSection(catchSection); - } - } - - private void checkCatchSection(PsiCatchSection catchSection) { - final PsiParameter parameter = catchSection.getParameter(); + public void visitCatchSection(PsiCatchSection section) { + super.visitCatchSection(section); + final PsiParameter parameter = section.getParameter(); if (parameter == null) { return; } - final PsiCodeBlock catchBlock = catchSection.getCatchBlock(); + final PsiCodeBlock catchBlock = section.getCatchBlock(); if (catchBlock == null) { return; }