void (VirtualFile[] givenRoots, Map<VirtualFile, Set<String>> fromClasses, Map<VirtualFile, Set<String>> toClasses) { for (VirtualFile root : givenRoots) { Set<String> fromClassNames = new HashSet<>(); Set<String> toClassNames = new HashSet<>(); VfsUtilCore.iterateChildrenRecursively(root, null, fileOrDir -> { if (!fileOrDir.isDirectory() && fileOrDir.getName().endsWith(".class")) { AbstractDependencyVisitor visitor = new AbstractDependencyVisitor() { @Override protected void addClassName(String name) { if (!name.startsWith("java.") && !name.startsWith("javax.")) { //ignore jdk classes toClassNames.add(name); } } }; try { visitor.processStream(fileOrDir.getInputStream()); fromClassNames.add(visitor.getCurrentClassName()); } catch (IOException e) { LOG.error(e); } } return true; }); toClassNames.removeAll(fromClassNames); fromClasses.put(root, fromClassNames); toClasses.put(root, toClassNames); } }