NodeToUpdate (@Nullable VirtualFile parent, @Nullable VirtualFile file, int childNameId, @NotNull MultiMap<? super VirtualFilePointerListener, ? super VirtualFilePointerImpl> toFirePointers, boolean createIfNotFound, boolean addRecursiveDirectoryPtr, @NotNull NewVirtualFileSystem childFs) { if (childNameId <= 0 && childNameId != JAR_SEPARATOR_NAME_ID) throw new IllegalArgumentException("invalid argument childNameId: " + childNameId); if (file != null) { VirtualFileSystem fsFromFile = file.getFileSystem(); assert childFs == fsFromFile : "fs=" + childFs + "; file.fs=" + fsFromFile+"; parent="+parent+"; file="+file; } List<VirtualFile> hierarchy = parent == null ? Collections.emptyList() : getHierarchy(parent); FilePartNode node = this; for (int i = hierarchy.size() - 1; i >= 0; i--) { VirtualFile part = hierarchy.get(i); int nameId = getNameId(part); FilePartNode child = node.findChildByNameId(part, nameId, createIfNotFound, (NewVirtualFileSystem)part.getFileSystem()); if (child == null) return null; if (child instanceof UrlPartNode) { // by some strange accident there is UrlPartNode when the corresponding file is alive and kicking - replace with proper FPPN child = child.replaceWithFPPN(part, node); } if (addRecursiveDirectoryPtr) { // recursive pointers must be fired even for events deep under them child.addRecursiveDirectoryPtrTo(toFirePointers); } node = child; } FilePartNode child = node.findChildByNameId(file, childNameId, createIfNotFound, childFs); return child == null ? null : new NodeToUpdate(node, child); }