void (Consumer<? super List<String>> onFinish) { AppJavaExecutorUtil.executeOnPooledIoThread(() -> { try { RecentProjectsManagerBase manager = (RecentProjectsManagerBase)RecentProjectsManager.getInstance(); @Nls String groupName = EclipseBundle.message("eclipse.projects"); ProjectGroup group = ContainerUtil.find(manager.getGroups(), g -> groupName.equals(g.getName())); String property = "eclipse.projects.detected"; if (group == null && PropertiesComponent.getInstance().isValueSet(property)) { // the group was removed by user return; } List<String> projects = new ArrayList<>(); new EclipseProjectDetector().collectProjectPaths(projects); HashSet<String> set = new HashSet<>(projects); if (!PropertiesComponent.getInstance().isValueSet(property)) { EclipseProjectDetectorUsagesCollector.logProjectsDetected(set.size()); PropertiesComponent.getInstance().setValue(property, ""); } projects.removeAll(manager.getRecentPaths()); if (projects.isEmpty()) return; if (group == null) { group = new ProjectGroup(groupName); group.setBottomGroup(true); group.setProjects(new ArrayList<>(set)); manager.addGroup(group); } else { group.getProjects().retainAll(set); } ProjectGroup finalGroup = group; ApplicationManager.getApplication().invokeLater(() -> onFinish.accept(finalGroup.getProjects())); } catch (Exception e) { LOG.error(e); } }); }