void () { final VirtualFile[] files; synchronized (myFilesToCheck) { files = myFilesToCheck.toArray(VirtualFile.EMPTY_ARRAY); myFilesToCheck.clear(); } if (files.length == 0) return; final int[] i = {0}; ProjectFileIndex fileIndex = ProjectFileIndex.getInstance(myProject); ReadAction.nonBlocking(() -> { if (myProject.isDisposed()) return; final List<VirtualFile> newEditedGeneratedFiles = new ArrayList<>(); try { while (i[0] < files.length) { ProgressManager.checkCanceled(); VirtualFile file = files[i[0]]; if (fileIndex.isInContent(file) || fileIndex.isInLibrary(file)) { if (GeneratedSourcesFilter.isGeneratedSourceByAnyFilter(file, myProject)) { newEditedGeneratedFiles.add(file); } } i[0]++; } } finally { // In case of canceled exception or (really) any other exception // some files could be already processed // let's not wait for the next available read lock slot if (!newEditedGeneratedFiles.isEmpty()) { myEditedGeneratedFiles.addAll(newEditedGeneratedFiles); EditorNotifications.getInstance(myProject).updateAllNotifications(); } } }).executeSynchronously(); }