|
1 | 1 | /* |
2 | | - * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
23 | 23 |
|
24 | 24 | /* |
25 | 25 | * @test |
26 | | - * @bug 8017191 8182765 8200432 8239804 8250766 8262992 |
| 26 | + * @bug 8017191 8182765 8200432 8239804 8250766 8262992 8281944 |
27 | 27 | * @summary Javadoc is confused by at-link to imported classes outside of the set of generated packages |
28 | | - * @library ../../lib |
| 28 | + * @library /tools/lib ../../lib |
29 | 29 | * @modules jdk.javadoc/jdk.javadoc.internal.tool |
30 | | - * @build javadoc.tester.* |
| 30 | + * @build toolbox.ToolBox javadoc.tester.* |
31 | 31 | * @run main TestSeeTag |
32 | 32 | */ |
33 | 33 |
|
34 | 34 | import javadoc.tester.JavadocTester; |
| 35 | +import toolbox.ToolBox; |
| 36 | + |
| 37 | +import java.io.IOException; |
| 38 | +import java.nio.file.Path; |
35 | 39 |
|
36 | 40 | public class TestSeeTag extends JavadocTester { |
37 | 41 |
|
@@ -105,4 +109,40 @@ public void testBadReference() { |
105 | 109 | </dd> |
106 | 110 | </dl>"""); |
107 | 111 | } |
| 112 | + |
| 113 | + ToolBox tb = new ToolBox(); |
| 114 | + |
| 115 | + @Test |
| 116 | + public void testErroneous() throws IOException { |
| 117 | + Path src = Path.of("erroneous", "src"); |
| 118 | + tb.writeJavaFiles(src, """ |
| 119 | + package erroneous; |
| 120 | + /** |
| 121 | + * Comment. |
| 122 | + * @see <a href=" |
| 123 | + */ |
| 124 | + public class C { |
| 125 | + private C() { } |
| 126 | + } |
| 127 | + """); |
| 128 | + |
| 129 | + javadoc("-d", Path.of("erroneous", "api").toString(), |
| 130 | + "-sourcepath", src.toString(), |
| 131 | + "--no-platform-links", |
| 132 | + "erroneous"); |
| 133 | + checkExit(Exit.ERROR); |
| 134 | + |
| 135 | + checkOutput("erroneous/C.html", true, |
| 136 | + """ |
| 137 | + <dl class="notes"> |
| 138 | + <dt>See Also:</dt> |
| 139 | + <dd> |
| 140 | + <ul class="see-list"> |
| 141 | + <li>invalid input: '<a href="'</li> |
| 142 | + </ul> |
| 143 | + </dd> |
| 144 | + </dl> |
| 145 | + """); |
| 146 | + |
| 147 | + } |
108 | 148 | } |
0 commit comments