void (@NotNull VirtualFile psiDirectory) { if (!myDirectory2Children.containsKey(psiDirectory)) { throw new IllegalArgumentException("directory is not in the tree: " + psiDirectory); } List<VirtualFile> children = myDirectory2Children.remove(psiDirectory); if (children == null) { throw new IllegalArgumentException("directory has no children list: " + psiDirectory); } if (children.size() > 0) { throw new IllegalArgumentException("directory isn't empty: " + psiDirectory); } // myStrictDirectory2Children.remove(psiDirectory); List<VirtualFile> dirsToBeRemoved = null; for (VirtualFile _directory : myDirectory2Children.keySet()) { children = myDirectory2Children.get(_directory); LOG.assertTrue(children != null); dirsToBeRemoved = collectDirsToRemove(psiDirectory, children, dirsToBeRemoved, _directory); } // if (dirsToBeRemoved != null) { for (VirtualFile dirToBeRemoved : dirsToBeRemoved) { removeDir(dirToBeRemoved); } } }