8180019: javadoc should treat failure to access URL as an error, not a warning.
authorksrini
Tue, 21 Nov 2017 13:17:06 -0800
changeset 47877 7e57d42b5eeb
parent 47876 5d4864563be7
child 47878 8794b5061a3e
8180019: javadoc should treat failure to access URL as an error, not a warning. Reviewed-by: jjg
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java
test/langtools/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java
test/langtools/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Tue Nov 21 13:07:26 2017 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Tue Nov 21 13:17:06 2017 -0800
@@ -223,7 +223,7 @@
             }
             return true;
         } catch (Fault f) {
-            reporter.print(Diagnostic.Kind.WARNING, f.getMessage());
+            reporter.print(Diagnostic.Kind.ERROR, f.getMessage());
             return false;
         }
     }
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java	Tue Nov 21 13:07:26 2017 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java	Tue Nov 21 13:17:06 2017 -0800
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @bug 4625883
- * @summary Make sure that bad -link arguments trigger warnings.
+ * @bug 4625883 8180019
+ * @summary Make sure that bad -link arguments trigger errors.
  * @author jamieh
  * @library ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -44,11 +44,10 @@
         String out = "out";
         javadoc("-d", out,
                 "-sourcepath", testSrc,
-                "-link", out,
+                "-link", "a-non-existent-link",
                 "pkg");
-        checkExit(Exit.OK);
+        checkExit(Exit.ERROR);
 
-        // TODO: the file it is trying to read, out/out/package-list, warrants investigation
         checkOutput(Output.OUT, true,
                 "Error reading file:");
     }
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java	Tue Nov 21 13:07:26 2017 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java	Tue Nov 21 13:17:06 2017 -0800
@@ -44,7 +44,7 @@
     void test() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
-                "-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api", testSrc,
+                "-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api", testSrc("jdk"),
                 "testNewLineInLink");
         checkExit(Exit.OK);