From 1d22a2c4e53f364c6b06ed283227ed5e2ed3beef Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Wed, 14 Oct 2009 18:15:29 +0400 Subject: [PATCH] processor should return false if terminated by ProcessCanceledException --- .../daemon/impl/LocalInspectionsPass.java | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java index 22639b81bd..c6ed79d3d0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java @@ -195,32 +195,32 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass final ProgressManager progressManager = ProgressManager.getInstance(); try { progressManager.checkCanceled(); - } - catch (ProcessCanceledException e) { - return false; - } - ApplicationManager.getApplication().assertReadAccessAllowed(); + ApplicationManager.getApplication().assertReadAccessAllowed(); - ProblemsHolder holder = new ProblemsHolder(iManager, myFile); - progressManager.checkCanceled(); - PsiElementVisitor elementVisitor = tool.buildVisitor(holder, isOnTheFly); - //noinspection ConstantConditions - if(elementVisitor == null) { - LOG.error("Tool " + tool + " must not return null from the buildVisitor() method"); - } - tool.inspectionStarted(session); - for (PsiElement element : elements) { + ProblemsHolder holder = new ProblemsHolder(iManager, myFile); progressManager.checkCanceled(); - element.accept(elementVisitor); - } - tool.inspectionFinished(session); - advanceProgress(elements.length); + PsiElementVisitor elementVisitor = tool.buildVisitor(holder, isOnTheFly); + //noinspection ConstantConditions + if(elementVisitor == null) { + LOG.error("Tool " + tool + " must not return null from the buildVisitor() method"); + } + tool.inspectionStarted(session); + for (PsiElement element : elements) { + progressManager.checkCanceled(); + element.accept(elementVisitor); + } + tool.inspectionFinished(session); + advanceProgress(elements.length); - if (holder.hasResults()) { - appendDescriptors(holder.getResults(), tool, ignoreSuppressed); + if (holder.hasResults()) { + appendDescriptors(holder.getResults(), tool, ignoreSuppressed); + } + return true; + } + catch (ProcessCanceledException e) { + return false; } - return true; } }, "Inspection tools"); -- 2.11.4.GIT