boolean (@NotNull LocalInspectionTool tool, @NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session, @NotNull List<? extends PsiElement> elements, Map<Class<?>, Collection<Class<?>>> targetPsiClasses) { PsiElementVisitor visitor = createVisitor(tool, holder, isOnTheFly, session); // if inspection returned empty visitor then it should be skipped if (visitor == PsiElementVisitor.EMPTY_VISITOR) return false; List<Class<?>> acceptingPsiTypes = InspectionVisitorsOptimizer.getAcceptingPsiTypes(visitor); tool.inspectionStarted(session, isOnTheFly); acceptElements(elements, visitor, targetPsiClasses, acceptingPsiTypes); tool.inspectionFinished(session, holder); return true; }