void () { List<? extends Change> changes = filter(myChanges, it -> it.getAfterRevision() != null); for (int i = 0; i < changes.size(); i++) { Change change = changes.get(i); ContentRevision beforeRevision = change.getBeforeRevision(); ContentRevision afterRevision = requireNonNull(change.getAfterRevision()); FilePath afterFilePath = afterRevision.getFile(); VirtualFile afterFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(afterFilePath.getPath()); EditedFileProcessorBase fileProcessor = ReadAction.compute(() -> { progress(afterFile != null ? ProjectUtil.calcRelativeToProjectPath(afterFile, myProject) : afterFilePath.getName()); if (afterFile == null || afterFile.isDirectory() || afterFile.getFileType().isBinary()) { return null; // skip detection } PsiFile afterPsiFile = afterFile.isValid() ? PsiManager.getInstance(myProject).findFile(afterFile) : null; if (afterPsiFile == null) { mySkipped.add(Pair.create(afterFilePath, VcsBundle.message("checkin.invalid.file.s"))); return null; } if (beforeRevision == null) { // take just all todos List<TodoItem> newTodoItems = collectTodoItems(afterPsiFile, false); myAddedOrEditedTodos.addAll(newTodoItems); return null; } Document afterDocument = FileDocumentManager.getInstance().getDocument(afterFile); if (afterDocument == null) { mySkipped.add(Pair.create(afterFilePath, VcsBundle.message("checkin.can.not.load.current.revision"))); return null; } String afterContent = afterDocument.getText(); List<? extends TodoItem> afterTodoItems = collectTodoItems(afterPsiFile, false); if (afterRevision instanceof CurrentContentRevision) { return new SimpleEditedFileProcessor(myProject, afterFilePath, beforeRevision, afterContent, afterTodoItems); } else { return new NonLocalEditedFileProcessor(myProject, afterFilePath, beforeRevision, afterRevision, afterContent, afterTodoItems); } }); try { if (fileProcessor != null) fileProcessor.process(); fraction((i + 1.0) / changes.size()); } catch (DiffTooBigException e) { LOG.info("File " + afterFilePath.getPath() + " is too big and there are too many changes to build a diff"); mySkipped.add(Pair.create(afterFilePath, VcsBundle.message("checkin.can.not.load.previous.revision"))); } } }