langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Fri Mar 10 09:52:49 2017 -0800
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Mon Mar 13 09:55:31 2017 -0700
@@ -134,7 +134,6 @@
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
if (configuration.allowTag(HtmlTag.MAIN)) {
htmlTree.addContent(div);
- body.addContent(htmlTree);
} else {
body.addContent(div);
}
@@ -182,7 +181,6 @@
addOverviewComment(div);
if (configuration.allowTag(HtmlTag.MAIN)) {
htmlTree.addContent(div);
- body.addContent(htmlTree);
} else {
body.addContent(div);
}
@@ -203,12 +201,16 @@
}
/**
- * Not required for this page.
+ * For HTML 5, add the htmlTree to the body. For HTML 4, do nothing.
*
* @param body the documentation tree to which the overview will be added
*/
@Override
- protected void addOverview(Content body) {}
+ protected void addOverview(Content body) {
+ if (configuration.allowTag(HtmlTag.MAIN)) {
+ body.addContent(htmlTree);
+ }
+ }
/**
* Adds the top text (from the -top option), the upper