void (String root) { VirtualFile jdkAnnoRoot = LocalFileSystem.getInstance().findFileByPath(root); VfsUtilCore.visitChildrenRecursively( jdkAnnoRoot, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile file) { if (file.getName().equals("annotations.xml")) { String assumedPackage = PathUtil.getRelative(root, file.getParent().getPath()).replaceAll("/", "."); checkSyntax(file, assumedPackage); } return true; } }); }