Skip to content
Permalink
Browse files
8264274: Block tags in overview.html are ignored
Reviewed-by: jjg
  • Loading branch information
hns committed Aug 17, 2021
1 parent c5c84b8 commit 0e3fde6c3c2f5c05777b79ff5eb1188014269b0f
Showing 3 changed files with 29 additions and 10 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,9 +66,8 @@ public AbstractOverviewIndexWriter(HtmlConfiguration configuration,
*/
protected void addOverviewHeader(Content main) {
addConfigurationTitle(main);
if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
addOverviewComment(main);
}
addOverviewComment(main);
addOverviewTags(main);
}

/**
@@ -84,6 +83,17 @@ protected void addOverviewComment(Content htmltree) {
}
}

/**
* Adds the block tags provided in the file specified by the "-overview" option.
*
* @param htmlTree the content tree to which the tags will be added
*/
protected void addOverviewTags(Content htmlTree) {
if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
addTagsInfo(configuration.overviewElement, htmlTree);
}
}

/**
* Generate and prints the contents in the index file.
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@

/*
* @test
* @bug 8173302 8182765 8196202 8210047
* @bug 8173302 8182765 8196202 8210047 8264274
* @summary make sure the overview-summary and module-summary pages don't
* don't have the See link, and the overview is copied correctly.
* @library ../../lib
@@ -50,7 +50,7 @@ public void test1() {
"-sourcepath", testSrc("src"),
"p1", "p2");
checkExit(Exit.OK);
checkOverview();
checkOverview("");
}

@Test
@@ -62,17 +62,25 @@ public void test2() {
"-sourcepath", testSrc("msrc"),
"p1", "p2");
checkExit(Exit.OK);
checkOverview();
checkOverview("acme/");
}

void checkOverview() {
void checkOverview(String modulePrefix) {
checkOutput("index.html", true,
"""
<main role="main">
<div class="header">
<h1 class="title">Document Title</h1>
</div>
<div class="block">This is line1. This is line 2.</div>
""");
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="%sp1/C.html" title="class in p1"><code>C</code></a></li>
</ul>
</dd>
</dl>
""".formatted(modulePrefix)); // adapt expected reference URL to module context
}
}
@@ -2,5 +2,6 @@
<html>
<body bgcolor="white">
This is line1. This is line 2.
@see p1.C
</body>
</html>

1 comment on commit 0e3fde6

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 0e3fde6 Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.