2022-03-21 21:33:14 +01:00
|
|
|
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
|
|
|
|
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
|
2022-03-21 23:27:14 +01:00
|
|
|
@@ -1015,6 +1015,9 @@ public class HtmlDocletWriter {
|
2022-03-21 21:33:14 +01:00
|
|
|
// @see reference label...
|
|
|
|
label = ref.subList(1, ref.size());
|
|
|
|
}
|
|
|
|
+ case ERRONEOUS -> {
|
2022-03-21 23:27:14 +01:00
|
|
|
+ return HtmlTree.SPAN(Text.of(resources.getText("doclet.tag.invalid_input", seeText)));
|
2022-03-21 21:33:14 +01:00
|
|
|
+ }
|
|
|
|
default ->
|
|
|
|
throw new IllegalStateException(ref.get(0).getKind().toString());
|
|
|
|
}
|
2022-03-21 21:58:45 +01:00
|
|
|
--- a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java
|
|
|
|
+++ b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java
|
|
|
|
@@ -23,15 +23,19 @@
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @test
|
|
|
|
- * @bug 8017191 8182765 8200432 8239804 8250766 8262992
|
|
|
|
+ * @bug 8017191 8182765 8200432 8239804 8250766 8262992 8281944
|
|
|
|
* @summary Javadoc is confused by at-link to imported classes outside of the set of generated packages
|
|
|
|
- * @library ../../lib
|
|
|
|
+ * @library /tools/lib ../../lib
|
|
|
|
* @modules jdk.javadoc/jdk.javadoc.internal.tool
|
|
|
|
- * @build javadoc.tester.*
|
|
|
|
+ * @build toolbox.ToolBox javadoc.tester.*
|
|
|
|
* @run main TestSeeTag
|
|
|
|
*/
|
|
|
|
|
|
|
|
import javadoc.tester.JavadocTester;
|
|
|
|
+import toolbox.ToolBox;
|
|
|
|
+
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.nio.file.Path;
|
|
|
|
|
|
|
|
public class TestSeeTag extends JavadocTester {
|
|
|
|
|
|
|
|
@@ -105,4 +109,40 @@ public class TestSeeTag extends JavadocTester {
|
|
|
|
</dd>
|
|
|
|
</dl>""");
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ ToolBox tb = new ToolBox();
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void testErroneous() throws IOException {
|
|
|
|
+ Path src = Path.of("erroneous", "src");
|
|
|
|
+ tb.writeJavaFiles(src, """
|
|
|
|
+ package erroneous;
|
|
|
|
+ /**
|
|
|
|
+ * Comment.
|
|
|
|
+ * @see <a href="
|
|
|
|
+ */
|
|
|
|
+ public class C {
|
|
|
|
+ private C() { }
|
|
|
|
+ }
|
|
|
|
+ """);
|
|
|
|
+
|
|
|
|
+ javadoc("-d", Path.of("erroneous", "api").toString(),
|
|
|
|
+ "-sourcepath", src.toString(),
|
|
|
|
+ "--no-platform-links",
|
|
|
|
+ "erroneous");
|
|
|
|
+ checkExit(Exit.ERROR);
|
|
|
|
+
|
|
|
|
+ checkOutput("erroneous/C.html", true,
|
|
|
|
+ """
|
|
|
|
+ <dl class="notes">
|
|
|
|
+ <dt>See Also:</dt>
|
|
|
|
+ <dd>
|
|
|
|
+ <ul class="see-list">
|
2022-03-21 23:27:14 +01:00
|
|
|
+ <li><span>invalid input: '<a href="'</span></li>
|
2022-03-21 21:58:45 +01:00
|
|
|
+ </ul>
|
|
|
|
+ </dd>
|
|
|
|
+ </dl>
|
|
|
|
+ """);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
}
|