boolean (@NotNull Module module, @NotNull final CoverageSuitesBundle suite, @NotNull final Runnable chooseSuiteAction) { if (suite.isModuleChecked(module)) return false; for (final JavaCoverageEngineExtension extension : JavaCoverageEngineExtension.EP_NAME.getExtensionList()) { Module moduleCandidate = extension.getModuleWithOutput(module); if (moduleCandidate != null) { module = moduleCandidate; break; } } final CoverageDataManager dataManager = CoverageDataManager.getInstance(module.getProject()); final boolean includeTests = suite.isTrackTestFolders(); final VirtualFile[] roots = JavaCoverageClassesEnumerator.getRoots(dataManager, module, includeTests); final boolean rootsExist = roots.length >= (includeTests ? 2 : 1) && ContainerUtil.all(roots, (root) -> root != null && root.exists()); if (!rootsExist) { final Project project = module.getProject(); suite.checkModule(module); LOG.debug("Going to ask to rebuild project. Include tests:" + includeTests + ". Module: " + module.getName() + ". Output roots are: "); for (VirtualFile root : roots) { LOG.debug(root.getPath() + " exists: " + root.exists()); } final Notification notification = new Notification("Coverage", JavaCoverageBundle.message("project.is.out.of.date"), JavaCoverageBundle.message("project.class.files.are.out.of.date"), NotificationType.INFORMATION); notification.addAction(NotificationAction.createSimpleExpiring(JavaCoverageBundle.message("coverage.recompile"), () -> { ProjectTaskManagerImpl.putBuildOriginator(project, this.getClass()); ProjectTaskManager taskManager = ProjectTaskManager.getInstance(project); Promise<ProjectTaskManager.Result> promise = taskManager.buildAllModules(); promise.onSuccess(result -> ApplicationManager.getApplication().invokeLater(() -> { CoverageDataManager.getInstance(project).chooseSuitesBundle(suite); }, o -> project.isDisposed()) ); })); CoverageNotifications.getInstance(project).addNotification(notification); notification.notify(project); } return false; }