diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java index 0f8b6f65885..029cf465b95 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java @@ -25,6 +25,8 @@ package jdk.javadoc.internal.doclets.formats.html; +import java.util.Collections; + import jdk.javadoc.internal.doclets.formats.html.markup.Head; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.DocType; @@ -78,6 +80,7 @@ public class IndexRedirectWriter extends HtmlDocletWriter { Content htmlComment = contents.newPage; Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion) .setTimestamp(true) + .setStylesheets(configuration.getMainStylesheet(), Collections.emptyList()) // avoid reference to default stylesheet .addDefaultScript(false); String title = (configuration.windowtitle.length() > 0) diff --git a/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java b/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java index 0de8b228776..47bae247ac9 100644 --- a/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java +++ b/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,9 +65,8 @@ public class TestBreakIterator extends JavadocTester { "
File",
- "glossary",
+ "index",
"Second File Link",
"The value of @docRoot is \"./\"");
diff --git a/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootTag.java b/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootTag.java
index b696144c7ef..d6b588cebf1 100644
--- a/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootTag.java
+++ b/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootTag.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/**
* Here is the use of link: {@link java.io.File File}
- * Here is the use of docRoot: glossary.
+ * Here is the use of docRoot: index.
* Here is the use of link: {@link java.io.File Second File Link}
*/
public class TestDocRootTag {}
diff --git a/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java b/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java
index 508aee0a814..822ea5a15ec 100644
--- a/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java
+++ b/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,14 @@ public class TestDocRootLink extends JavadocTester {
public static void main(String... args) throws Exception {
TestDocRootLink tester = new TestDocRootLink();
+
+ // The test files intentionally contain examples of links that should
+ // or should not be affected by the -Xdocrootparent option, and the
+ // results are checked explicitly; so, disable the automatic link
+ // checker to prevent spurious "missing files" errors from some of
+ // these links.
+ tester.setAutomaticCheckLinks(false);
+
tester.runTests();
}
diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java
index 74c8f4e943f..a607618d907 100644
--- a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java
@@ -57,6 +57,7 @@ public class TestHtmlLandmarkRegions extends JavadocTester {
TestHtmlLandmarkRegions() {
tb = new ToolBox();
+ setAutomaticCheckLinks(false); // @ignore 8217013
}
@Test
diff --git a/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java b/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java
index f4b33d1f63b..d2ab5ffc08b 100644
--- a/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java
+++ b/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -83,6 +83,7 @@ public class TestIndexWithModules extends JavadocTester {
//multiple modules with frames
@Test
public void testIndexWithMultipleModules1(Path base) throws Exception {
+ setAutomaticCheckLinks(false); // @ignore 8217013
Path out = base.resolve("out");
javadoc("-d", out.toString(),
"--module-source-path", src.toString(),
@@ -98,6 +99,7 @@ public class TestIndexWithModules extends JavadocTester {
"m1",
"m3",
"m4");
+ setAutomaticCheckLinks(true); // @ignore 8217013
}
//multiple modules with out frames
diff --git a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java
index b9fe192ed77..ac8284653fd 100644
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -115,6 +115,7 @@ public class TestLinkOption extends JavadocTester {
);
String out1_html4 = "out1-html4";
+ setAutomaticCheckLinks(false); // The example code has toy/bad links
javadoc("-d", out1_html4,
"-source", "8",
"-html4",
@@ -134,6 +135,8 @@ public class TestLinkOption extends JavadocTester {
+ ""
+ "createTempFile(prefix, suffix, null).link to mylib.lang.StringBuilderChild.\n"
);
+
+ setAutomaticCheckLinks(true); // re-enable checks
}
/*
diff --git a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java
index b9263e63eaf..1854e6a479e 100644
--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4749567 8071982 8175200 8186332 8185371 8182765
+ * @bug 4749567 8071982 8175200 8186332 8185371 8182765 8217034
* @summary Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree,
* -stylesheetfile, --main-stylesheet, --add-stylesheet options.
* @author Bhavesh Patel
diff --git a/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java b/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java
index 6352077ebb0..57c83e47123 100644
--- a/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java
+++ b/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,10 @@
* @run main TestRelativeLinks
*/
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
import javadoc.tester.JavadocTester;
public class TestRelativeLinks extends JavadocTester {
@@ -106,5 +110,27 @@ public class TestRelativeLinks extends JavadocTester {
"-sourcepath", testSrc,
"pkg", "pkg2");
checkExit(Exit.OK);
-}
+ }
+
+ @Override
+ public void checkLinks() {
+ // since the test uses explicit links to non-existent files,
+ // we create those files to avoid false positive errors from checkLinks
+ touch("pkg/relative-class-link.html");
+ touch("pkg/relative-field-link.html");
+ touch("pkg/relative-method-link.html");
+ touch("pkg/relative-package-link.html");
+ touch("pkg/relative-multi-line-link.html");
+ super.checkLinks();
+ }
+
+ private void touch(String file) {
+ File f = new File(outputDir, file);
+ out.println("touch " + f);
+ try (FileOutputStream fos = new FileOutputStream(f)) {
+ } catch (IOException e) {
+ checking("Touch file");
+ failed("Error creating file: " + e);
+ }
+ }
}
diff --git a/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java b/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java
index cbde9930b46..a384c1d0c2f 100644
--- a/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java
+++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java
@@ -72,7 +72,7 @@ public class LinkChecker extends HtmlChecker {
missingFiles.stream()
.sorted()
.forEach(this::reportMissingFile);
-
+ errors += missingFiles.size();
}
if (!allURIs.isEmpty()) {