Export valid XML even if an exception was thrown during inspections pass

Previously `</problems>` was not printed in such case, for example, in AppCode Swift Performance tests (e.g. `ReactiveSwiftPerformanceTest.testInspections`)

GitOrigin-RevId: d89f3366f82b2461f1af8fe13808035c43d8f7f7
This commit is contained in:
Egor Zhdan
2020-07-31 10:07:22 +00:00
committed by intellij-monorepo-bot
parent 85b6a868f2
commit a66b0a2a4f
@@ -70,8 +70,12 @@ public class GlobalInspectionContextEx extends GlobalInspectionContextBase {
final Runnable action = () -> {
myOutputDir = outputDir;
try {
performInspectionsWithProgress(scope, runGlobalToolsOnly, isOfflineInspections);
exportResultsSmart(inspectionsResults, outputDir);
try {
performInspectionsWithProgress(scope, runGlobalToolsOnly, isOfflineInspections);
}
finally {
exportResultsSmart(inspectionsResults, outputDir);
}
}
finally {
myOutputDir = null;