Skip to content

Commit d9f2134

Browse files
8258655: remove <-- NewPage --> comment from generated pages
Reviewed-by: hannesw
1 parent c956e7a commit d9f2134

File tree

5 files changed

+7
-25
lines changed

5 files changed

+7
-25
lines changed

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ public class Contents {
140140
public final Content navProperty;
141141
public final Content navServices;
142142
public final Content nestedClassSummary;
143-
public final Content newPage;
144143
public final Content noScriptMessage;
145144
public final Content openModuleLabel;
146145
public final Content openedTo;
@@ -287,7 +286,6 @@ public class Contents {
287286
navProperty = getContent("doclet.navProperty");
288287
navServices = getContent("doclet.navServices");
289288
nestedClassSummary = getContent("doclet.Nested_Class_Summary");
290-
newPage = new Comment(resources.getText("doclet.New_Page"));
291289
noScriptMessage = getContent("doclet.No_Script_Message");
292290
openedTo = getContent("doclet.OpenedTo");
293291
openModuleLabel = getContent("doclet.Open_Module");

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ public void printHtmlDocument(List<String> metakeywords,
459459
List<DocPath> localStylesheets,
460460
Content body)
461461
throws DocFileIOException {
462-
Content htmlComment = contents.newPage;
463462
List<DocPath> additionalStylesheets = configuration.getAdditionalStylesheets();
464463
additionalStylesheets.addAll(localStylesheets);
465464
Head head = new Head(path, configuration.getDocletVersion(), configuration.startTime)
@@ -473,8 +472,8 @@ public void printHtmlDocument(List<String> metakeywords,
473472
.setIndex(options.createIndex(), mainBodyScript)
474473
.addContent(extraHeadContent);
475474

476-
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body);
477-
HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
475+
HtmlDocument htmlDocument = new HtmlDocument(
476+
HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body));
478477
htmlDocument.write(DocFile.createFileForOutput(configuration, path));
479478
}
480479

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ private IndexRedirectWriter(HtmlConfiguration configuration, DocPath filename, D
7474
* @throws DocFileIOException if there is a problem generating the file
7575
*/
7676
private void generateIndexFile() throws DocFileIOException {
77-
Content htmlComment = contents.newPage;
7877
Head head = new Head(path, configuration.getDocletVersion(), configuration.startTime)
7978
.setTimestamp(!options.noTimestamp())
8079
.setDescription("index redirect")
@@ -109,8 +108,8 @@ private void generateIndexFile() throws DocFileIOException {
109108
HtmlTree main = HtmlTree.MAIN(bodyContent);
110109
body.add(main);
111110

112-
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body);
113-
HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
111+
HtmlDocument htmlDocument = new HtmlDocument(
112+
HtmlTree.HTML(configuration.getLocale().getLanguage(), head, body));
114113
htmlDocument.write(DocFile.createFileForOutput(configuration, path));
115114
}
116115
}

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,15 @@
4545
*/
4646
public class HtmlDocument {
4747
private final DocType docType = DocType.HTML5;
48-
private final List<Content> docContent;
49-
50-
/**
51-
* Constructor to construct an HTML document.
52-
*
53-
* @param docComment comment for the document
54-
* @param htmlTree HTML tree of the document
55-
*/
56-
public HtmlDocument(Content docComment, Content htmlTree) {
57-
docContent = Arrays.asList(docComment, htmlTree);
58-
}
48+
private final Content docContent;
5949

6050
/**
6151
* Constructor to construct an HTML document.
6252
*
6353
* @param htmlTree HTML tree of the document
6454
*/
6555
public HtmlDocument(Content htmlTree) {
66-
docContent = Collections.singletonList(htmlTree);
56+
docContent = htmlTree;
6757
}
6858

6959
/**
@@ -93,9 +83,6 @@ public String toString() {
9383
private void write(Writer writer) throws IOException {
9484
writer.write(docType.text);
9585
writer.write(DocletConstants.NL);
96-
boolean atNewline = true;
97-
for (Content c : docContent) {
98-
atNewline = c.write(writer, atNewline);
99-
}
86+
docContent.write(writer, true);
10087
}
10188
}

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ doclet.Window_Split_Index={0}-Index
7272
doclet.Help=Help
7373
doclet.Skip_navigation_links=Skip navigation links
7474
doclet.Navigation=Navigation
75-
doclet.New_Page=NewPage
7675
doclet.navDeprecated=Deprecated
7776
doclet.Window_Deprecated_List=Deprecated List
7877
doclet.Window_Preview_List=Preview List

0 commit comments

Comments
 (0)