void (@NotNull Collection<? extends VirtualFile> filesToRefresh, @NotNull DefaultMutableTreeNode rootNode) { if (!(rootNode.getUserObject() instanceof ProjectViewNode node)) return; Collection<VirtualFile> containingFiles = null; for (VirtualFile virtualFile : filesToRefresh) { if (!virtualFile.isValid()) { addSubtreeToUpdate(rootNode); // file must be deleted return; } if (node.contains(virtualFile)) { if (containingFiles == null) containingFiles = new SmartList<>(); containingFiles.add(virtualFile); } } if (containingFiles != null) { updateNode(rootNode); Enumeration children = rootNode.children(); while (children.hasMoreElements()) { DefaultMutableTreeNode child = (DefaultMutableTreeNode)children.nextElement(); updateNodesContaining(containingFiles, child); } } }