langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
changeset 44689 53c703004306
parent 44684 6ce4d52084e8
child 44807 47e09e3f1829
equal deleted inserted replaced
44688:7ef050121b50 44689:53c703004306
   288         }
   288         }
   289         });
   289         });
   290 
   290 
   291         // Get all packages for the module and put it in the concealed packages set.
   291         // Get all packages for the module and put it in the concealed packages set.
   292         utils.getModulePackageMap().getOrDefault(mdle, Collections.emptySet()).forEach((pkg) -> {
   292         utils.getModulePackageMap().getOrDefault(mdle, Collections.emptySet()).forEach((pkg) -> {
   293             if (shouldDocument(pkg)) {
   293             if (shouldDocument(pkg) && moduleMode == ModuleMode.ALL) {
   294                 concealedPackages.add(pkg);
   294                 concealedPackages.add(pkg);
   295             }
   295             }
   296         });
   296         });
   297 
   297 
   298         // Get all exported packages for the module using the exports directive for the module.
   298         // Get all exported packages for the module using the exports directive for the module.
   307                 // Qualified exports should not be displayed in the api mode. So if mdleList is empty,
   307                 // Qualified exports should not be displayed in the api mode. So if mdleList is empty,
   308                 // its exported to all modules and hence can be added.
   308                 // its exported to all modules and hence can be added.
   309                 if (moduleMode == ModuleMode.ALL || mdleList.isEmpty()) {
   309                 if (moduleMode == ModuleMode.ALL || mdleList.isEmpty()) {
   310                     exportedPackages.put(p, mdleList);
   310                     exportedPackages.put(p, mdleList);
   311                 }
   311                 }
   312                 concealedPackages.remove(p);
   312                 if (moduleMode == ModuleMode.ALL) {
       
   313                     concealedPackages.remove(p);
       
   314                 }
   313             }
   315             }
   314         });
   316         });
   315         // Get all opened packages for the module using the opens directive for the module.
   317         // Get all opened packages for the module using the opens directive for the module.
   316         (ElementFilter.opensIn(mdle.getDirectives())).forEach((directive) -> {
   318         (ElementFilter.opensIn(mdle.getDirectives())).forEach((directive) -> {
   317             PackageElement p = directive.getPackage();
   319             PackageElement p = directive.getPackage();
   324                 // Qualified opens should not be displayed in the api mode. So if mdleList is empty,
   326                 // Qualified opens should not be displayed in the api mode. So if mdleList is empty,
   325                 // it is opened to all modules and hence can be added.
   327                 // it is opened to all modules and hence can be added.
   326                 if (moduleMode == ModuleMode.ALL || mdleList.isEmpty()) {
   328                 if (moduleMode == ModuleMode.ALL || mdleList.isEmpty()) {
   327                     openedPackages.put(p, mdleList);
   329                     openedPackages.put(p, mdleList);
   328                 }
   330                 }
   329                 concealedPackages.remove(p);
   331                 if (moduleMode == ModuleMode.ALL) {
       
   332                     concealedPackages.remove(p);
       
   333                 }
   330             }
   334             }
   331         });
   335         });
   332         // Remove all the exported and opened packages so we have just the concealed packages now.
       
   333         concealedPackages.removeAll(exportedPackages.keySet());
       
   334         concealedPackages.removeAll(openedPackages.keySet());
       
   335         // Get all the exported and opened packages, for the transitive closure of the module, to be displayed in
   336         // Get all the exported and opened packages, for the transitive closure of the module, to be displayed in
   336         // the indirect packages tables.
   337         // the indirect packages tables.
   337         dependentModules.forEach((module, mod) -> {
   338         dependentModules.forEach((module, mod) -> {
   338             SortedSet<PackageElement> pkgList = new TreeSet<>(utils.makePackageComparator());
   339             SortedSet<PackageElement> pkgList = new TreeSet<>(utils.makePackageComparator());
   339             (ElementFilter.exportsIn(module.getDirectives())).forEach((directive) -> {
   340             (ElementFilter.exportsIn(module.getDirectives())).forEach((directive) -> {