ProjectData (@NotNull final File sessionDataFile, @Nullable final CoverageSuite coverageSuite) { ProjectData projectData = ProjectDataLoader.load(sessionDataFile); File sourceMapFile = new File(JavaCoverageEnabledConfiguration.getSourceMapPath(sessionDataFile.getPath())); if (sourceMapFile.exists()) { try { CoverageReport.loadAndApplySourceMap(projectData, sourceMapFile); } catch (IOException e) { LOG.warn("Error reading source map associated with coverage data", e); } } if (coverageSuite instanceof JavaCoverageSuite javaSuite) { // Do not overwrite existing patterns if present, as they are written in the format expected by IDEA, // while the patterns passed to the agent are converted to the regex format. if (ArrayUtil.isEmpty(javaSuite.getIncludeFilters())) { String[] includeFilters = extractPatterns(projectData.getIncudePatterns()); javaSuite.setIncludeFilters(includeFilters); } if (ArrayUtil.isEmpty(javaSuite.getExcludePatterns())) { String[] excludePatterns = extractPatterns(projectData.getExcludePatterns()); javaSuite.setExcludePatterns(excludePatterns); } } return projectData; }