Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8248409: some jdk/javadoc/doclet tests fail (JDK 15)
Reviewed-by: prappo
  • Loading branch information
jonathan-gibbons committed Jun 30, 2020
1 parent 0f43de9 commit 46ff8fdce97775f2efef98702e86c1c9f4d12751
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 24 deletions.
@@ -26,6 +26,7 @@
package jdk.javadoc.internal;

import java.util.ResourceBundle;
import java.util.stream.Collectors;

import static java.util.ResourceBundle.getBundle;

@@ -77,15 +78,18 @@ public static Runtime.Version javadocVersion() throws RuntimeException {
/**
* Returns a short string representation of the provided version.
*
* <p> Examples of strings returned from this method are: "15" and
* "15-internal".
* <p> The string contains the dotted representation of the version number,
* followed by the prerelease info, if any.
* For example, "15", "15.1", "15.0.1", "15-internal".
*
* @return a short string representation of the provided version
*
* @throws NullPointerException if {@code v == null}
*/
public static String shortVersionStringOf(Runtime.Version v) {
String svstr = String.valueOf(v.feature());
String svstr = v.version().stream()
.map(Object::toString)
.collect(Collectors.joining("."));
if (v.pre().isPresent()) {
svstr += "-" + v.pre().get();
}
@@ -159,11 +159,6 @@ public Runtime.Version getDocletVersion() {
return docletVersion;
}

@Override
public String getDocletVersionString() {
return Versions.shortVersionStringOf(docletVersion);
}

@Override
public Resources getDocResources() {
return docResources;
@@ -431,7 +431,7 @@ public void printHtmlDocument(List<String> metakeywords,
Content htmlComment = contents.newPage;
List<DocPath> additionalStylesheets = configuration.getAdditionalStylesheets();
additionalStylesheets.addAll(localStylesheets);
Head head = new Head(path, configuration.getDocletVersionString(), configuration.startTime)
Head head = new Head(path, configuration.getDocletVersion(), configuration.startTime)
.setTimestamp(!options.noTimestamp())
.setDescription(description)
.setGenerator(getGenerator(getClass()))
@@ -75,7 +75,7 @@ private IndexRedirectWriter(HtmlConfiguration configuration, DocPath filename, D
*/
private void generateIndexFile() throws DocFileIOException {
Content htmlComment = contents.newPage;
Head head = new Head(path, configuration.getDocletVersionString(), configuration.startTime)
Head head = new Head(path, configuration.getDocletVersion(), configuration.startTime)
.setTimestamp(!options.noTimestamp())
.setDescription("index redirect")
.setGenerator(getGenerator(getClass()))
@@ -235,7 +235,7 @@ public void convertClass(TypeElement te, DocPath outputdir)
* @param path the path for the file.
*/
private void writeToFile(Content body, DocPath path, TypeElement te) throws DocFileIOException {
Head head = new Head(path, configuration.getDocletVersionString(), configuration.startTime)
Head head = new Head(path, configuration.getDocletVersion(), configuration.startTime)
// .setTimestamp(!options.notimestamp) // temporary: compatibility!
.setTitle(resources.getText("doclet.Window_Source_title"))
// .setCharset(options.charset) // temporary: compatibility!
@@ -49,7 +49,7 @@
* deletion without notice.</b>
*/
public class Head extends Content {
private final String docletVersion;
private final Runtime.Version docletVersion;
private final Date generatedDate;
private final DocPath pathToRoot;
private String title;
@@ -74,9 +74,9 @@ public class Head extends Content {
* recording the time the file was created.
* The doclet version should also be provided for recording in the file.
* @param path the path for the file that will include this HEAD element
* @param docletVersion a string identifying the doclet version
* @param docletVersion the doclet version
*/
public Head(DocPath path, String docletVersion, Date generatedDate) {
public Head(DocPath path, Runtime.Version docletVersion, Date generatedDate) {
this.docletVersion = docletVersion;
this.generatedDate = generatedDate;
pathToRoot = path.parent().invert();
@@ -295,7 +295,7 @@ private Content toContent() {
private Comment getGeneratedBy(boolean timestamp, Date now) {
String text = "Generated by javadoc"; // marker string, deliberately not localized
if (timestamp) {
text += " ("+ docletVersion + ") on " + now;
text += " ("+ docletVersion.feature() + ") on " + now;
}
return new Comment(text);
}
@@ -157,14 +157,6 @@ public abstract class BaseConfiguration {
*/
public abstract Runtime.Version getDocletVersion();

/**
* Returns a short string representation of the version returned by
* {@linkplain #getDocletVersion()}.
*
* @return a short string representation of the version
*/
public abstract String getDocletVersionString();

/**
* This method should be defined in all those doclets (configurations),
* which want to derive themselves from this BaseConfiguration. This method
@@ -79,7 +79,7 @@ void checkTimestamps(boolean timestamp) {
}

void checkTimestamps(boolean timestamp, String... files) {
String version = System.getProperty("java.version");
String version = System.getProperty("java.specification.version");
String genBy = "Generated by javadoc";
if (timestamp) genBy += " (" + version + ") on ";

0 comments on commit 46ff8fd

Please sign in to comment.