Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8264274: Block tags in overview.html are ignored #5099

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -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.
*
Expand Down
20 changes: 14 additions & 6 deletions test/langtools/jdk/javadoc/doclet/testOverview/TestOverview.java
@@ -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
Expand All @@ -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
Expand All @@ -50,7 +50,7 @@ public void test1() {
"-sourcepath", testSrc("src"),
"p1", "p2");
checkExit(Exit.OK);
checkOverview();
checkOverview("");
}

@Test
Expand All @@ -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
}
}
Expand Up @@ -2,5 +2,6 @@
<html>
<body bgcolor="white">
This is line1. This is line 2.
@see p1.C
</body>
</html>