Skip to content
Permalink
Browse files
8258655: remove <-- NewPage --> comment from generated pages
Reviewed-by: hannesw
  • Loading branch information
jonathan-gibbons committed Jan 11, 2021
1 parent c956e7a commit d9f21346bf26c74a155679f1184e88ddea395350
@@ -140,7 +140,6 @@
public final Content navProperty;
public final Content navServices;
public final Content nestedClassSummary;
public final Content newPage;
public final Content noScriptMessage;
public final Content openModuleLabel;
public final Content openedTo;
@@ -287,7 +286,6 @@
navProperty = getContent("doclet.navProperty");
navServices = getContent("doclet.navServices");
nestedClassSummary = getContent("doclet.Nested_Class_Summary");
newPage = new Comment(resources.getText("doclet.New_Page"));
noScriptMessage = getContent("doclet.No_Script_Message");
openedTo = getContent("doclet.OpenedTo");
openModuleLabel = getContent("doclet.Open_Module");
@@ -459,7 +459,6 @@ public void printHtmlDocument(List<String> metakeywords,
List<DocPath> localStylesheets,
Content body)
throws DocFileIOException {
Content htmlComment = contents.newPage;
List<DocPath> additionalStylesheets = configuration.getAdditionalStylesheets();
additionalStylesheets.addAll(localStylesheets);
Head head = new Head(path, configuration.getDocletVersion(), configuration.startTime)
@@ -473,8 +472,8 @@ public void printHtmlDocument(List<String> metakeywords,
.setIndex(options.createIndex(), mainBodyScript)
.addContent(extraHeadContent);

Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body);
HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
HtmlDocument htmlDocument = new HtmlDocument(
HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body));
htmlDocument.write(DocFile.createFileForOutput(configuration, path));
}

@@ -74,7 +74,6 @@ private IndexRedirectWriter(HtmlConfiguration configuration, DocPath filename, D
* @throws DocFileIOException if there is a problem generating the file
*/
private void generateIndexFile() throws DocFileIOException {
Content htmlComment = contents.newPage;
Head head = new Head(path, configuration.getDocletVersion(), configuration.startTime)
.setTimestamp(!options.noTimestamp())
.setDescription("index redirect")
@@ -109,8 +108,8 @@ private void generateIndexFile() throws DocFileIOException {
HtmlTree main = HtmlTree.MAIN(bodyContent);
body.add(main);

Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body);
HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
HtmlDocument htmlDocument = new HtmlDocument(
HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body));
htmlDocument.write(DocFile.createFileForOutput(configuration, path));
}
}
@@ -45,25 +45,15 @@
*/
public class HtmlDocument {
private final DocType docType = DocType.HTML5;
private final List<Content> docContent;

/**
* Constructor to construct an HTML document.
*
* @param docComment comment for the document
* @param htmlTree HTML tree of the document
*/
public HtmlDocument(Content docComment, Content htmlTree) {
docContent = Arrays.asList(docComment, htmlTree);
}
private final Content docContent;

/**
* Constructor to construct an HTML document.
*
* @param htmlTree HTML tree of the document
*/
public HtmlDocument(Content htmlTree) {
docContent = Collections.singletonList(htmlTree);
docContent = htmlTree;
}

/**
@@ -93,9 +83,6 @@ public String toString() {
private void write(Writer writer) throws IOException {
writer.write(docType.text);
writer.write(DocletConstants.NL);
boolean atNewline = true;
for (Content c : docContent) {
atNewline = c.write(writer, atNewline);
}
docContent.write(writer, true);
}
}
@@ -72,7 +72,6 @@ doclet.Window_Split_Index={0}-Index
doclet.Help=Help
doclet.Skip_navigation_links=Skip navigation links
doclet.Navigation=Navigation
doclet.New_Page=NewPage
doclet.navDeprecated=Deprecated
doclet.Window_Deprecated_List=Deprecated List
doclet.Window_Preview_List=Preview List

1 comment on commit d9f2134

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on d9f2134 Jan 11, 2021

Please sign in to comment.