void (@NotNull VirtualFile child, @NotNull NewVirtualFileSystem delegate) { ApplicationEx app = ApplicationManagerEx.getApplicationEx(); if (SHOULD_PERFORM_ACCESS_CHECK && app.isUnitTestMode() && app.isComponentCreated() && !ApplicationManagerEx.isInStressTest()) { if (delegate != LocalFileSystem.getInstance() && delegate != JarFileSystem.getInstance()) { return; } // root' children are loaded always if (child.getParent() == null || child.getParent().getParent() == null) { return; } Set<String> allowed = allowedRoots(); boolean isUnder = allowed == null || allowed.isEmpty(); if (!isUnder) { VirtualFile local = child; if (delegate == JarFileSystem.getInstance()) { local = JarFileSystem.getInstance().getVirtualFileForJar(child); assert local != null : child; } for (String root : allowed) { if (VfsUtilCore.isAncestorOrSelf(root, local)) { isUnder = true; break; } if (root.startsWith(JarFileSystem.PROTOCOL_PREFIX)) { String rootLocalPath = FileUtil.toSystemIndependentName(PathUtil.toPresentableUrl(root)); isUnder = VfsUtilCore.isAncestorOrSelf(rootLocalPath, local); if (isUnder) break; } } } assert isUnder : "File accessed outside allowed roots: " + child + ";\nAllowed roots: " + new ArrayList<>(allowed); } }