ChangeApplier (@NotNull List<? extends @NotNull VFileEvent> events) { if (events.isEmpty()) { return null; } Set<File> filesChanged = FileCollectionFactory.createCanonicalFileSet(); Set<File> filesDeleted = FileCollectionFactory.createCanonicalFileSet(); List<VFileEvent> processLaterEvents = new SmartList<>(); for (VFileEvent event : events) { if (!isToProcess(event)) { continue; } if (isAfterProcessEvent(event)) { processLaterEvents.add(event); } if (event instanceof VFileDeleteEvent || event instanceof VFileMoveEvent) { collectPaths(event.getFile(), filesDeleted, true); } else if (event instanceof VFileContentChangeEvent) { collectPaths(event.getFile(), filesChanged, true); } else { handleFileRename(event, e -> collectDeletedPathsOnFileRename(e, filesDeleted)); } } return processLaterEvents.isEmpty() && filesDeleted.isEmpty() && filesChanged.isEmpty()? null : new ChangeApplier() { @Override public void afterVfsChange() { after(processLaterEvents, filesDeleted, filesChanged); } }; }