void (Project project) { final Integer fileCount = project.getUserData(FILE_COUNT); if (fileCount == null) { myFileIndex.iterateContent(fileOrDir -> { if (!fileOrDir.isDirectory()) { counting(); } return true; }); for (VirtualFile root : LibraryUtil.getLibraryRoots(project)) { countFilesRecursively(root); } project.putUserData(FILE_COUNT, myTotalFileCount); } else { myTotalFileCount = fileCount.intValue(); } }