diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index ce5e9b6cbfae..29057fce81fe 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -167,27 +167,27 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp cleanupTools(); setCurrentScope(scope); - DefaultInspectionToolPresentation.setOutputPath(outputPath); - try { - final Runnable action = new Runnable() { - @Override - public void run() { - performInspectionsWithProgress(scope, runGlobalToolsOnly, isOfflineInspections); + DefaultInspectionToolPresentation.setOutputPath(null); + final Runnable action = new Runnable() { + @Override + public void run() { + performInspectionsWithProgress(scope, runGlobalToolsOnly, isOfflineInspections); + DefaultInspectionToolPresentation.setOutputPath(outputPath); + try { exportResults(inspectionsResults, outputPath); } - }; - if (isOfflineInspections) { - ApplicationManager.getApplication().runReadAction(action); - } - else { - action.run(); + finally { + DefaultInspectionToolPresentation.setOutputPath(null); + } } + }; + if (isOfflineInspections) { + ApplicationManager.getApplication().runReadAction(action); } - finally { - DefaultInspectionToolPresentation.setOutputPath(null); + else { + action.run(); } } - private void exportResults(@NotNull List inspectionsResults, @Nullable String outputPath) { @NonNls final String ext = ".xml";