Skip to content

Commit

Permalink
Creating a separate javadoc section for the preview 'requires transit…
Browse files Browse the repository at this point in the history
…ive java.base;' in the java.se module.
  • Loading branch information
lahodaj committed Nov 5, 2024
1 parent 9ae10e2 commit 219b21b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

import com.sun.source.doctree.DeprecatedTree;
import com.sun.source.doctree.DocTree;
import java.util.stream.Collectors;

import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
import jdk.javadoc.internal.doclets.formats.html.Navigation.PageMode;
Expand Down Expand Up @@ -582,10 +583,22 @@ protected void addPackagesSummary(Content summariesList) {
TableHeader indirectPackagesHeader =
new TableHeader(contents.fromLabel, contents.packagesLabel);
if (display(indirectPackages)) {
Map<ModuleElement, SortedSet<PackageElement>> filteredIndirectPackages = indirectPackages;
boolean javaSEModule = mdle.getQualifiedName().contentEquals("java.se");
if (javaSEModule) {
filteredIndirectPackages = filteredIndirectPackages.entrySet().stream().filter(e -> !e.getKey().getQualifiedName().contentEquals("java.base")).collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
}
String aepText = resources.getText("doclet.Indirect_Exports_Summary");
var aepTable = getTable2(Text.of(aepText), indirectPackagesHeader);
addIndirectPackages(aepTable, indirectPackages);
addIndirectPackages(aepTable, filteredIndirectPackages);
section.add(aepTable);
if (javaSEModule) {
filteredIndirectPackages = indirectPackages.entrySet().stream().filter(e -> e.getKey().getQualifiedName().contentEquals("java.base")).collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
String aepPreviewText = resources.getText("doclet.Indirect_Exports_Preview_Summary");
var aepPreviewTable = getTable2(Text.of(aepPreviewText), indirectPackagesHeader);
addIndirectPackages(aepPreviewTable, filteredIndirectPackages);
section.add(aepPreviewTable);
}
}
if (display(indirectOpenPackages)) {
String aopText = resources.getText("doclet.Indirect_Opens_Summary");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ doclet.Package_Summary=Package Summary
doclet.Requires_Summary=Requires
doclet.Indirect_Requires_Summary=Indirect Requires
doclet.Indirect_Exports_Summary=Indirect Exports
doclet.Indirect_Exports_Preview_Summary=Indirect Exports (Preview Feature)
doclet.Indirect_Opens_Summary=Indirect Opens
doclet.Exported_Packages_Summary=Exports
doclet.Opened_Packages_Summary=Opens
Expand Down

0 comments on commit 219b21b

Please sign in to comment.