Set<String> (File chunkModuleInfo, Iterable<? extends File> path) { final Set<String> result = new HashSet<>(); // first, add all requires from chunk module-info final JavaModuleDescriptor chunkDescr = new JavaProjectBuilder(new OrderedClassLibraryBuilder()).addSourceFolder(chunkModuleInfo.getParentFile()).getDescriptor(); for (JavaModuleDescriptor.JavaRequires require : chunkDescr.getRequires()) { final JavaModule rm = require.getModule(); if (rm != null) { result.add(rm.getName()); } } for (File file : path) { result.addAll(getModuleInfo(file).requires); } return result; }