From 1b2c40fb5866219ea84a1ea75169b52be902fc0c Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 26 Apr 2013 14:26:14 +0400 Subject: [PATCH] cleanup --- .../daemon/impl/LocalInspectionsPass.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 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 98aa94e0f073..a30b8d03bec0 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 @@ -145,7 +145,6 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass } public void doInspectInBatch(@NotNull InspectionManagerEx iManager, @NotNull List toolWrappers) { - ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator(); inspect(new ArrayList(toolWrappers), iManager, false, false, false, progress); addDescriptorsFromInjectedResults(iManager); @@ -159,7 +158,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass } } - private void addDescriptorsFromInjectedResults(InspectionManagerEx iManager) { + private void addDescriptorsFromInjectedResults(@NotNull InspectionManagerEx iManager) { InjectedLanguageManager ilManager = InjectedLanguageManager.getInstance(myProject); PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject); @@ -225,6 +224,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass addHighlightsFromResults(myInfos, indicator); } + @NotNull private static MultiMap getToolsForElements(@NotNull List toolWrappers, boolean checkDumbAwareness, @NotNull List inside, @@ -293,15 +293,14 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass } private List visitPriorityElementsAndInit(@NotNull MultiMap tools, - @NotNull final InspectionManagerEx iManager, - final boolean isOnTheFly, - @NotNull final ProgressIndicator indicator, - @NotNull final List elements, - @NotNull final LocalInspectionToolSession session, - @NotNull List wrappers, - boolean checkDumbAwareness) { - - final ArrayList init = new ArrayList(); + @NotNull final InspectionManagerEx iManager, + final boolean isOnTheFly, + @NotNull final ProgressIndicator indicator, + @NotNull final List elements, + @NotNull final LocalInspectionToolSession session, + @NotNull List wrappers, + boolean checkDumbAwareness) { + final List init = new ArrayList(); List>> entries = new ArrayList>>(tools.entrySet()); Processor>> processor = new Processor>>() { @@ -785,7 +784,8 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass }; LocalInspectionToolSession injSession = new LocalInspectionToolSession(injectedPsi, 0, injectedPsi.getTextLength()); - createVisitorAndAcceptElements(tool, holder, isOnTheFly, injSession, elements, (Set)pair.getValue()); + Collection languages = pair.getValue(); + createVisitorAndAcceptElements(tool, holder, isOnTheFly, injSession, elements, languages); tool.inspectionFinished(injSession, holder); List problems = holder.getResults(); if (!problems.isEmpty()) { @@ -811,7 +811,10 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass } private static class InspectionContext { - private InspectionContext(@NotNull LocalInspectionToolWrapper tool, @NotNull ProblemsHolder holder, @NotNull PsiElementVisitor visitor, @Nullable Collection languageIds) { + private InspectionContext(@NotNull LocalInspectionToolWrapper tool, + @NotNull ProblemsHolder holder, + @NotNull PsiElementVisitor visitor, + @Nullable Collection languageIds) { this.tool = tool; this.holder = holder; this.visitor = visitor;