Skip to content

Commit

Permalink
8344271: Comparison build fails due to difference in doc summary
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Nov 15, 2024
1 parent 40a055e commit b18784e
Showing 1 changed file with 13 additions and 15 deletions.
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.function.Predicate;
import java.util.stream.Collectors;

import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
Expand Down Expand Up @@ -591,14 +592,10 @@ protected void addPackagesSummary(Content summariesList) {
.anyMatch(rd -> rd.isTransitive() &&
javaBase.equals(rd.getDependency()));
if (hasRequiresTransitiveJavaBase) {
Map<ModuleElement, SortedSet<PackageElement>> filteredIndirectPackages =
indirectPackages.entrySet()
.stream()
.filter(e -> !e.getKey().equals(javaBase))
.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, filteredIndirectPackages);
addIndirectPackages(aepTable, indirectPackages,
m -> !m.equals(javaBase));
section.add(aepTable);
//add the preview box:
section.add(HtmlTree.BR());
Expand All @@ -614,30 +611,26 @@ protected void addPackagesSummary(Content summariesList) {
section.add(previewDiv);

//add the Indirect Exports
filteredIndirectPackages =
indirectPackages.entrySet()
.stream()
.filter(e -> e.getKey().equals(javaBase))
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
String aepPreviewText = resources.getText("doclet.Indirect_Exports_Summary");
ContentBuilder tableCaption = new ContentBuilder(
Text.of(aepPreviewText),
HtmlTree.SUP(links.createLink(previewRequiresTransitiveId,
contents.previewMark)));
var aepPreviewTable = getTable2(tableCaption, indirectPackagesHeader);
addIndirectPackages(aepPreviewTable, filteredIndirectPackages);
addIndirectPackages(aepPreviewTable, indirectPackages,
m -> m.equals(javaBase));
section.add(aepPreviewTable);
} else {
String aepText = resources.getText("doclet.Indirect_Exports_Summary");
var aepTable = getTable2(Text.of(aepText), indirectPackagesHeader);
addIndirectPackages(aepTable, indirectPackages);
addIndirectPackages(aepTable, indirectPackages, _ -> true);
section.add(aepTable);
}
}
if (display(indirectOpenPackages)) {
String aopText = resources.getText("doclet.Indirect_Opens_Summary");
var aopTable = getTable2(Text.of(aopText), indirectPackagesHeader);
addIndirectPackages(aopTable, indirectOpenPackages);
addIndirectPackages(aopTable, indirectOpenPackages, _ -> true);
section.add(aopTable);
}
summariesList.add(HtmlTree.LI(section));
Expand Down Expand Up @@ -768,9 +761,14 @@ private Content getPackageExportOpensTo(Set<ModuleElement> modules) {
* @param table the table to which the content rows will be added
* @param ip indirect packages to be added
*/
public void addIndirectPackages(Table<?> table, Map<ModuleElement, SortedSet<PackageElement>> ip) {
public void addIndirectPackages(Table<?> table,
Map<ModuleElement, SortedSet<PackageElement>> ip,
Predicate<ModuleElement> acceptModule) {
for (Map.Entry<ModuleElement, SortedSet<PackageElement>> entry : ip.entrySet()) {
ModuleElement m = entry.getKey();
if (!acceptModule.test(m)) {
continue;
}
SortedSet<PackageElement> pkgList = entry.getValue();
Content moduleLinkContent = getModuleLink(m, Text.of(m.getQualifiedName()));
Content list = new ContentBuilder();
Expand Down

0 comments on commit b18784e

Please sign in to comment.