List<String> () { return ReadAction.compute(() -> { CachedUrls cache = myCache; long actualModCount = Arrays.stream(ProjectManager.getInstance().getOpenProjects()) .map(ProjectRootManager::getInstance) .mapToLong(ProjectRootManager::getModificationCount) .sum(); String[] urls; if (cache != null && actualModCount == cache.myModificationCount) { urls = cache.myUrls; } else { Collection<String> excludedUrls = new HashSet<>(); for (Project project : ProjectManager.getInstance().getOpenProjects()) { for (Module module : ModuleManager.getInstance(project).getModules()) { Collections.addAll(excludedUrls, ModuleRootManager.getInstance(module).getExcludeRootUrls()); } } urls = ArrayUtilRt.toStringArray(excludedUrls); Arrays.sort(urls); myCache = new CachedUrls(actualModCount, urls); } return Arrays.asList(urls); }); }