PackageDependenciesNode (PsiPackage aPackage, OrderEntry libraryOrJdk) { if (aPackage == null || aPackage.getName() == null) { return getLibraryOrJDKNode(libraryOrJdk); } if (!myShowModules && !myGroupByScopeType) { return getModuleDirNode(aPackage, null, ScopeType.LIB); } Pair<OrderEntry, PsiPackage> descriptor = Pair.create(myShowIndividualLibs ? libraryOrJdk : null, aPackage); PackageNode node = getMap(myLibraryPackageNodes, ScopeType.LIB).get(descriptor); if (node != null) return node; node = new PackageNode(aPackage, myFlattenPackages); getMap(myLibraryPackageNodes, ScopeType.LIB).put(descriptor, node); if (myFlattenPackages) { getLibraryOrJDKNode(libraryOrJdk).add(node); } else { getLibraryDirNode(aPackage.getParentPackage(), libraryOrJdk).add(node); } return node; }