diff --git a/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextBase.java b/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextBase.java index 3ff195c2659c..df4b32f43f13 100644 --- a/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextBase.java +++ b/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextBase.java @@ -446,24 +446,19 @@ public class GlobalInspectionContextBase extends UserDataHolderBase implements G int old = job.getDoneAmount(); job.setDoneAmount(old + 1); - float totalProgress = getTotalProgress(job); + float totalProgress = getTotalProgress(); myProgressIndicator.setFraction(totalProgress); myProgressIndicator.setText(job.getDisplayName() + " " + message); } - private float getTotalProgress(@NotNull JobDescriptor currentJob) { + private float getTotalProgress() { int totalDone = 0; int totalTotal = 0; for (JobDescriptor jobDescriptor : myJobDescriptors) { totalDone += jobDescriptor.getDoneAmount(); totalTotal += jobDescriptor.getTotalAmount(); } - // if we run e.g. just "Annotator" simple global tool then myJobDescriptors are empty - if (myJobDescriptors.isEmpty()) { - totalDone += currentJob.getDoneAmount(); - totalTotal += currentJob.getTotalAmount(); - } return totalTotal == 0 ? 1 : 1.0f * totalDone / totalTotal; } diff --git a/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionToolWrapper.java b/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionToolWrapper.java index 3d167950731b..0e77e25928a7 100644 --- a/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionToolWrapper.java +++ b/platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionToolWrapper.java @@ -15,13 +15,11 @@ */ package com.intellij.codeInspection.ex; -import com.intellij.codeInspection.GlobalInspectionContext; -import com.intellij.codeInspection.GlobalInspectionTool; -import com.intellij.codeInspection.InspectionEP; -import com.intellij.codeInspection.LocalInspectionTool; +import com.intellij.codeInspection.*; import com.intellij.codeInspection.reference.RefGraphAnnotator; import com.intellij.codeInspection.reference.RefManagerImpl; import com.intellij.util.ArrayUtil; +import com.intellij.util.ObjectUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -66,13 +64,20 @@ public class GlobalInspectionToolWrapper extends InspectionToolWrapper