From 048bc83dfaab052520c5cc72717fc8a9b18025c7 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Wed, 20 Dec 2023 16:19:27 +0800 Subject: [PATCH] Check if the output directory exists or not --- .../microsoft/java/test/plugin/coverage/CoverageHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/coverage/CoverageHandler.java b/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/coverage/CoverageHandler.java index c6670d1d..e3cc3e8a 100644 --- a/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/coverage/CoverageHandler.java +++ b/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/coverage/CoverageHandler.java @@ -77,6 +77,9 @@ public List getCoverageDetail(IProgressMonitor monitor) thro final Analyzer analyzer = new Analyzer( execFileLoader.getExecutionDataStore(), coverageBuilder); final File outputDirectory = getFileForFs(javaProject, entry.getKey()); + if (!outputDirectory.exists()) { + continue; + } analyzer.analyzeAll(outputDirectory); final Map> classCoverageBySourceFilePath = groupClassCoverageBySourceFilePath(coverageBuilder.getClasses());