void (PsiJavaModule module, MultiMap<PsiJavaModule, PsiJavaModule> relations, Set<String> transitiveEdges) { if (!(module instanceof LightJavaModule) && !relations.containsKey(module)) { relations.putValues(module, Collections.emptyList()); boolean explicitJavaBase = false; for (PsiRequiresStatement statement : module.getRequires()) { PsiJavaModuleReference ref = statement.getModuleReference(); if (ref != null) { if (PsiJavaModule.JAVA_BASE.equals(ref.getCanonicalText())) explicitJavaBase = true; for (ResolveResult result : ref.multiResolve(false)) { PsiJavaModule dependency = (PsiJavaModule)result.getElement(); assert dependency != null : result; relations.putValue(module, dependency); if (statement.hasModifierProperty(PsiModifier.TRANSITIVE)) transitiveEdges.add(RequiresGraph.key(dependency, module)); visit(dependency, relations, transitiveEdges); } } } if (!explicitJavaBase) { PsiJavaModule javaBase = JavaPsiFacade.getInstance(module.getProject()).findModule(PsiJavaModule.JAVA_BASE, module.getResolveScope()); if (javaBase != null) relations.putValue(module, javaBase); } } }