Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 1d87958

Browse files
committedJun 17, 2020
8243113: Always identify version of javadoc used to generate docs
Reviewed-by: prappo
1 parent 44d4e37 commit 1d87958

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed
 

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ private Content toContent() {
294294

295295
private Comment getGeneratedBy(boolean timestamp, Date now) {
296296
String text = "Generated by javadoc"; // marker string, deliberately not localized
297+
text += " (" + docletVersion + ")";
297298
if (timestamp) {
298-
text += " ("+ docletVersion + ") on " + now;
299+
text += " on " + now;
299300
}
300301
return new Comment(text);
301302
}

‎test/langtools/jdk/javadoc/doclet/testGeneratedBy/TestGeneratedBy.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8000418 8024288 8196202
26+
* @bug 8000418 8024288 8196202 8243113
2727
* @summary Verify that files use a common Generated By string
2828
* @library ../../lib
2929
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -80,19 +80,17 @@ void checkTimestamps(boolean timestamp) {
8080

8181
void checkTimestamps(boolean timestamp, String... files) {
8282
String version = System.getProperty("java.version");
83-
String genBy = "Generated by javadoc";
84-
if (timestamp) genBy += " (" + version + ") on ";
83+
String genBy = "Generated by javadoc (" + version + ")";
84+
if (timestamp) genBy += " on ";
8585

8686
for (String file: files) {
8787
// genBy is the current standard "Generated by" text
8888
checkOutput(file, true, genBy);
8989

9090
// These are older versions of the "Generated by" text
9191
checkOutput(file, false,
92-
(timestamp
93-
? "Generated by javadoc (version"
94-
: "Generated by javadoc ("),
95-
"Generated by javadoc on");
92+
"Generated by javadoc (version",
93+
"Generated by javadoc on");
9694
}
9795
}
9896
}

‎test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8203792
26+
* @bug 8203792 8243113
2727
* @summary Remove "compatibility" features from Head.java
2828
* @library /tools/lib ../../lib
2929
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -44,6 +44,7 @@
4444
public class TestHeadTag extends JavadocTester {
4545

4646
final ToolBox tb;
47+
final String version = System.getProperty("java.version");
4748

4849
public static void main(String... args) throws Exception {
4950
TestHeadTag tester = new TestHeadTag();
@@ -67,7 +68,7 @@ public void test(Path base) throws Exception {
6768
checkExit(Exit.OK);
6869

6970
checkOrder("pkg/A.html",
70-
"Generated by javadoc",
71+
"Generated by javadoc (" + version + ")",
7172
"<meta name=\"dc.created\"");
7273
}
7374

@@ -85,7 +86,7 @@ public void testWithNoTimestamp(Path base) throws Exception {
8586
checkExit(Exit.OK);
8687

8788
checkOutput("pkg/A.html", true,
88-
"<!-- Generated by javadoc -->");
89+
"<!-- Generated by javadoc (" + version + ") -->");
8990
checkOutput("pkg/A.html", false,
9091
"<meta name=\"dc.created\"");
9192
}

0 commit comments

Comments
 (0)
This repository has been archived.