8369531: Wrong tooltip used in external class links

Reviewed-by: liach
This commit is contained in:
Hannes Wallnöfer 2025-11-26 14:07:06 +00:00
parent 85d4f551b1
commit 0a3809f0be
23 changed files with 171 additions and 185 deletions

View File

@ -908,12 +908,13 @@ public abstract class HtmlDocletWriter {
* @param refMemName the name of the member being referenced. This should
* be null or empty string if no member is being referenced.
* @param label the label for the external link.
* @param title the title for the link
* @param style optional style for the link.
* @param code true if the label should be code font.
* @return the link
*/
public Content getCrossClassLink(TypeElement classElement, String refMemName,
Content label, HtmlStyle style, boolean code) {
Content label, String title, HtmlStyle style, boolean code) {
if (classElement != null) {
String className = utils.getSimpleName(classElement);
PackageElement packageElement = utils.containingPackage(classElement);
@ -931,9 +932,7 @@ public abstract class HtmlDocletWriter {
DocLink link = configuration.extern.getExternalLink(packageElement, pathToRoot,
className + ".html", refMemName);
return links.createLink(link,
(label == null) || label.isEmpty() ? defaultLabel : label, style,
resources.getText("doclet.Href_Class_Or_Interface_Title",
getLocalizedPackageName(packageElement)), true);
(label == null) || label.isEmpty() ? defaultLabel : label, style, title, true);
}
}
return null;

View File

@ -305,7 +305,7 @@ public class HtmlLinkFactory {
} else {
Content crossLink = m_writer.getCrossClassLink(
typeElement, linkInfo.getFragment(),
label, linkInfo.getStyle(), true);
label, linkInfo.getTitle(), linkInfo.getStyle(), true);
if (crossLink != null) {
link.add(crossLink);
addSuperscript(link, flags, null, typeElement, previewTarget, restrictedTarget);
@ -361,7 +361,7 @@ public class HtmlLinkFactory {
if (fileName != null) {
return m_writer.links.createLink(fileName.fragment(id.name()), label);
} else if (typeElement != null) {
return (m_writer.getCrossClassLink(typeElement, id.name(), label, null, false));
return (m_writer.getCrossClassLink(typeElement, id.name(), label, null, null, false));
} else {
return label;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -197,7 +197,7 @@ public class Links {
if (style != null) {
l.setStyle(style);
}
if (title != null && title.length() != 0) {
if (title != null && !title.isEmpty()) {
l.put(HtmlAttr.TITLE, title);
}
if (isExternal) {

View File

@ -51,7 +51,6 @@ doclet.Href_Annotation_Interface_Title=annotation interface in {0}
doclet.Href_Enum_Title=enum in {0}
doclet.Href_Enum_Class_Title=enum class in {0}
doclet.Href_Type_Param_Title=type parameter in {0}
doclet.Href_Class_Or_Interface_Title=class or interface in {0}
doclet.Summary=Summary:
doclet.Detail=Detail:
doclet.Module_Sub_Nav=Module:

View File

@ -51,7 +51,6 @@ doclet.Href_Annotation_Interface_Title=Annotationsschnittstelle in {0}
doclet.Href_Enum_Title=Enum in {0}
doclet.Href_Enum_Class_Title=Enum-Klasse in {0}
doclet.Href_Type_Param_Title=Typparameter in {0}
doclet.Href_Class_Or_Interface_Title=Klasse oder Schnittstelle in {0}
doclet.Summary=Übersicht:
doclet.Detail=Details:
doclet.Module_Sub_Nav=Modul:

View File

@ -51,7 +51,6 @@ doclet.Href_Annotation_Interface_Title={0}内の注釈インタフェース
doclet.Href_Enum_Title={0}内の列挙型
doclet.Href_Enum_Class_Title={0}の列挙クラス
doclet.Href_Type_Param_Title={0}内の型パラメータ
doclet.Href_Class_Or_Interface_Title={0}内のクラスまたはインタフェース
doclet.Summary=概要:
doclet.Detail=詳細:
doclet.Module_Sub_Nav=モジュール:

View File

@ -51,7 +51,6 @@ doclet.Href_Annotation_Interface_Title={0} 中的批注接口
doclet.Href_Enum_Title={0}中的枚举
doclet.Href_Enum_Class_Title={0} 中的枚举类
doclet.Href_Type_Param_Title={0}中的类型参数
doclet.Href_Class_Or_Interface_Title={0}中的类或接口
doclet.Summary=概要:
doclet.Detail=详细资料:
doclet.Module_Sub_Nav=模块:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, 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
@ -24,6 +24,7 @@
/*
* @test
* @bug 4652655 4857717 8025633 8026567 8071982 8164407 8182765 8205593 8240169
* 8369531
* @summary This test verifies that class cross references work properly.
* @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -58,18 +59,18 @@ public class TestClassCrossReferences extends JavadocTester {
"<a href=\"" + uri + """
java/math/package-summary.html" class="external-link"><code>Link to math package</code></a>""",
"<a href=\"" + uri + """
javax/swing/text/AbstractDocument.AttributeContext.html" title="class or interfa\
ce in javax.swing.text" class="external-link"><code>Link to AttributeContext inn\
erclass</code></a>""",
javax/swing/text/AbstractDocument.AttributeContext.html" title="interface in jav\
ax.swing.text" class="external-link"><code>Link to AttributeContext innerclass</\
code></a>""",
"<a href=\"" + uri + """
java/math/BigDecimal.html" title="class or interface in java.math" class="extern\
al-link"><code>Link to external class BigDecimal</code></a>""",
java/math/BigDecimal.html" title="class in java.math" class="external-link"><cod\
e>Link to external class BigDecimal</code></a>""",
"<a href=\"" + uri + """
java/math/BigInteger.html#gcd-java.math.BigInteger-" title="class or interface i\
n java.math" class="external-link"><code>Link to external member gcd</code></a>""",
java/math/BigInteger.html#gcd-java.math.BigInteger-" class="external-link"><code\
>Link to external member gcd</code></a>""",
"<a href=\"" + uri + """
javax/tools/SimpleJavaFileObject.html#uri" title="class or interface in javax.to\
ols" class="external-link"><code>Link to external member URI</code></a>""",
javax/tools/SimpleJavaFileObject.html#uri" class="external-link"><code>Link to e\
xternal member URI</code></a>""",
"""
<dl class="notes">
<dt>Overrides:</dt>
@ -95,18 +96,18 @@ public class TestClassCrossReferences extends JavadocTester {
"<a href=\"" + uri + """
java/math/package-summary.html" class="external-link"><code>Link to math package</code></a>""",
"<a href=\"" + uri + """
javax/swing/text/AbstractDocument.AttributeContext.html" title="class or interfa\
ce in javax.swing.text" class="external-link"><code>Link to AttributeContext inn\
erclass</code></a>""",
javax/swing/text/AbstractDocument.AttributeContext.html" title="interface in jav\
ax.swing.text" class="external-link"><code>Link to AttributeContext innerclass</\
code></a>""",
"<a href=\"" + uri + """
java/math/BigDecimal.html" title="class or interface in java.math" class="extern\
al-link"><code>Link to external class BigDecimal</code></a>""",
java/math/BigDecimal.html" title="class in java.math" class="external-link"><cod\
e>Link to external class BigDecimal</code></a>""",
"<a href=\"" + uri + """
java/math/BigInteger.html#gcd-java.math.BigInteger-" title="class or interface i\
n java.math" class="external-link"><code>Link to external member gcd</code></a>""",
java/math/BigInteger.html#gcd-java.math.BigInteger-" class="external-link"><code\
>Link to external member gcd</code></a>""",
"<a href=\"" + uri + """
javax/tools/SimpleJavaFileObject.html#uri" title="class or interface in javax.to\
ols" class="external-link"><code>Link to external member URI</code></a>""",
javax/tools/SimpleJavaFileObject.html#uri" class="external-link"><code>Link to e\
xternal member URI</code></a>""",
"""
<dl class="notes">
<dt>Overrides:</dt>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, 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
@ -57,11 +57,11 @@ public class TestDocRootInlineTag extends JavadocTester {
checkOutput("TestDocRootTag.html", true,
"<a href=\"" + uri + """
/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>""",
/java/io/File.html" title="class in java.io" class="external-link"><code>File</code></a>""",
"""
<a href="./index-all.html">index</a>""",
"<a href=\"" + uri + """
/java/io/File.html" title="class or interface in java.io" class="external-link"><code>Second File Link</code></a>""",
/java/io/File.html" title="class in java.io" class="external-link"><code>Second File Link</code></a>""",
"The value of @docRoot is \"./\"");
checkOutput("index-all.html", true,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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 4857717 8025633 8026567 8164407 8182765 8205593
* @bug 4857717 8025633 8026567 8164407 8182765 8205593 8369531
* @summary Test to make sure that externally overridden and implemented methods
* are documented properly. The method should still include "implements" or
* "overrides" documentation even though the method is external.
@ -56,15 +56,17 @@ public class TestExternalOverriddenMethod extends JavadocTester {
"""
<dt>Overrides:</dt>
<dd><code><a href=\"""" + uri + """
/java/io/FilterReader.html#read--" title="class or interface in java.io" class="\
external-link">read</a></code>&nbsp;in class&nbsp;<code><a href=\"""" + uri + """
/java/io/FilterReader.html" title="class or interface in java.io" class="external-link">FilterReader</a></code></dd>""",
/java/io/FilterReader.html#read--" class="external-link">read</a></code>&nbsp;in \
class&nbsp;<code><a href=\"""" + uri + """
/java/io/FilterReader.html" title="class in java.io" class="external-link">Filter\
Reader</a></code></dd>""",
"""
<dt>Specified by:</dt>
<dd><code><a href=\"""" + uri + """
/java/io/DataInput.html#readInt--" title="class or interface in java.io" class="\
external-link">readInt</a></code>&nbsp;in interface&nbsp;<code><a href=\"""" + uri + """
/java/io/DataInput.html" title="class or interface in java.io" class="external-link">DataInput</a></code></dd>"""
/java/io/DataInput.html#readInt--" class="external-link">readInt</a></code>&nbsp;\
in interface&nbsp;<code><a href=\"""" + uri + """
/java/io/DataInput.html" title="interface in java.io" class="external-link">DataI\
nput</a></code></dd>"""
);
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8177280 8262992 8259499 8307377 8352249
* @bug 8177280 8262992 8259499 8307377 8352249 8369531
* @summary see and link tag syntax should allow generic types
* @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -53,13 +53,13 @@ public class TestGenericTypeLink extends JavadocTester {
checkOutput("pkg1/A.html", true,
"""
<div class="block"><code><a href="http://example.com/docs/api/java.base/java/util/L\
ist.html" title="class or interface in java.util" class="external-link">List</a>&lt\
;<a href="http://example.com/docs/api/java.base/java/lang/String.html" title="class\
or interface in java.lang" class="external-link">String</a>&gt;</code>
<a href="http://example.com/docs/api/java.base/java/util/List.html" title="class o\
r interface in java.util" class="external-link">List</a>&lt;? extends <a href="http\
://example.com/docs/api/java.base/java/lang/CharSequence.html" title="class or inte\
rface in java.lang" class="external-link">CharSequence</a>&gt;
ist.html" title="interface in java.util" class="external-link">List</a>&lt;<a href=\
"http://example.com/docs/api/java.base/java/lang/String.html" title="class in java.\
lang" class="external-link">String</a>&gt;</code>
<a href="http://example.com/docs/api/java.base/java/util/List.html" title="interfac\
e in java.util" class="external-link">List</a>&lt;? extends <a href="http://example\
.com/docs/api/java.base/java/lang/CharSequence.html" title="interface in java.lang"\
class="external-link">CharSequence</a>&gt;
<a href="#someMethod(java.util.List,int)"><code>someMethod(ArrayList&lt;Integer&gt\
;, int)</code></a>
<a href="#otherMethod(java.util.Map,double)"><code>otherMethod(Map&lt;String, Stri\
@ -72,20 +72,19 @@ public class TestGenericTypeLink extends JavadocTester {
<dd>
<ul class="tag-list-long">
<li><code><a href="http://example.com/docs/api/java.base/java/util/Map.html" title="\
class or interface in java.util" class="external-link">Map</a>&lt;<a href="http://ex\
ample.com/docs/api/java.base/java/lang/String.html" title="class or interface in jav\
a.lang" class="external-link">String</a>, ? extends <a href="http://example.com/\
docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.la\
ng" class="external-link">CharSequence</a>&gt;</code></li>
interface in java.util" class="external-link">Map</a>&lt;<a href="http://example.com\
/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="externa\
l-link">String</a>, ? extends <a href="http://example.com/docs/api/java.base/java/la\
ng/CharSequence.html" title="interface in java.lang" class="external-link">CharSeque\
nce</a>&gt;</code></li>
<li><code><a href="http://example.com/docs/api/java.base/java/util/Map.html" title="\
class or interface in java.util" class="external-link">Map</a>&lt;<a href="http://ex\
ample.com/docs/api/java.base/java/lang/String.html" title="class or interface in jav\
a.lang" class="external-link">String</a>, ? super <a href="A.html" title="class \
in pkg1">A</a>&lt;<a href="http://example.com/docs/api/java.base/java/lang/String.ht\
ml" title="class or interface in java.lang" class="external-link">String</a>, ? \
extends <a href="http://example.com/docs/api/java.base/java/lang/RuntimeException.ht\
ml" title="class or interface in java.lang" class="external-link">RuntimeException</\
a>&gt;&gt;</code></li>
interface in java.util" class="external-link">Map</a>&lt;<a href="http://example.com\
/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="externa\
l-link">String</a>, ? super <a href="A.html" title="class in pkg1">A</a>&lt;<a href=\
"http://example.com/docs/api/java.base/java/lang/String.html" title="class in java.l\
ang" class="external-link">String</a>, ? extends <a href="http://example.com/docs/ap\
i/java.base/java/lang/RuntimeException.html" title="class in java.lang" class="exter\
nal-link">RuntimeException</a>&gt;&gt;</code></li>
<li><a href="#someMethod(java.util.List,int)"><code>someMethod(List&lt;Number&gt;, i\
nt)</code></a></li>
<li><a href="#otherMethod(java.util.Map,double)"><code>otherMethod(Map&lt;String, ? \
@ -96,11 +95,11 @@ public class TestGenericTypeLink extends JavadocTester {
checkOutput("pkg1/A.SomeException.html", true,
"""
<div class="block"><code><a href="A.html" title="class in pkg1">A</a>&lt;<a href="h\
ttp://example.com/docs/api/java.base/java/lang/String.html" title="class or interfa\
ce in java.lang" class="external-link">String</a>, <a href="A.SomeException.htm\
l" title="class in pkg1">A.SomeException</a>&gt;</code>
<a href="http://example.com/docs/api/java.base/java/util/Map.html" title="class or\
interface in java.util" class="external-link">link to generic type with label</a>\
ttp://example.com/docs/api/java.base/java/lang/String.html" title="class in java.la\
ng" class="external-link">String</a>, <a href="A.SomeException.html" title="class i\
n pkg1">A.SomeException</a>&gt;</code>
<a href="http://example.com/docs/api/java.base/java/util/Map.html" title="\
interface in java.util" class="external-link">link to generic type with label</a>\
</div>""",
"""
<dl class="notes">
@ -108,12 +107,11 @@ public class TestGenericTypeLink extends JavadocTester {
<dd>
<ul class="tag-list-long">
<li><code><a href="A.html" title="class in pkg1">A</a>&lt;<a href="http://example.c\
om/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang\
" class="external-link">String</a>, <a href="A.SomeException.html" title="class\
in pkg1">A.SomeException</a>&gt;</code></li>
<li><a href="http://example.com/docs/api/java.base/java/util/List.html" title="clas\
s or interface in java.util" class="external-link">Link to generic type with label<\
/a></li>
om/docs/api/java.base/java/lang/String.html" title="class in java.lang" class="exte\
rnal-link">String</a>, <a href="A.SomeException.html" title="class in pkg1">A.SomeE\
xception</a>&gt;</code></li>
<li><a href="http://example.com/docs/api/java.base/java/util/List.html" title="inte\
rface in java.util" class="external-link">Link to generic type with label</a></li>
</ul>
</dd>
</dl>"""
@ -125,19 +123,18 @@ public class TestGenericTypeLink extends JavadocTester {
<dd>
<ul class="tag-list-long">
<li><code><a href="A.html" title="class in pkg1">A</a>&lt;<a href="http://exampl\
e.com/docs/api/java.base/java/lang/String.html" title="class or interface in jav\
a.lang" class="external-link">String</a>, <a href="http://example.com/docs/a\
pi/java.base/java/lang/RuntimeException.html" title="class or interface in java.\
lang" class="external-link">RuntimeException</a>&gt;.<a href="A.Inner.html" titl\
e="class in pkg1">Inner</a></code></li>
e.com/docs/api/java.base/java/lang/String.html" title="class in java.lang" class\
="external-link">String</a>, <a href="http://example.com/docs/api/java.base/java\
/lang/RuntimeException.html" title="class in java.lang" class="external-link">Ru\
ntimeException</a>&gt;.<a href="A.Inner.html" title="class in pkg1">Inner</a></c\
ode></li>
<li><code><a href="A.html" title="class in pkg1">A</a>&lt;<a href="A.html" title\
="class in pkg1">A</a>&lt;<a href="http://example.com/docs/api/java.base/java/la\
ng/String.html" title="class or interface in java.lang" class="external-link">St\
ring</a>, <a href="http://example.com/docs/api/java.base/java/lang/RuntimeEx\
ception.html" title="class or interface in java.lang" class="external-link">Runt\
imeException</a>&gt;.<a href="A.Inner.html" title="class in pkg1">Inner</a>, \
<a href="A.SomeException.html" title="class in pkg1">A.SomeException</a>&gt;</c\
ode></li>
ng/String.html" title="class in java.lang" class="external-link">String</a>, <a \
href="http://example.com/docs/api/java.base/java/lang/RuntimeException.html" tit\
le="class in java.lang" class="external-link">RuntimeException</a>&gt;.<a href="\
A.Inner.html" title="class in pkg1">Inner</a>, <a href="A.SomeException.html" ti\
tle="class in pkg1">A.SomeException</a>&gt;</code></li>
</ul>
</dd>
</dl>""");
@ -148,10 +145,10 @@ public class TestGenericTypeLink extends JavadocTester {
/a></code></span></div>
<div class="block">Here's a generic link: <code><a href="A.html" title="class in\
pkg1">A</a>&lt;<a href="http://example.com/docs/api/java.base/java/lang/Object.\
html" title="class or interface in java.lang" class="external-link">Object</a>, \
<a href="http://example.com/docs/api/java.base/java/lang/RuntimeException.ht\
ml" title="class or interface in java.lang" class="external-link">RuntimeExcepti\
on</a>&gt;.<a href="A.Inner.html" title="class in pkg1">Inner</a>""");
html" title="class in java.lang" class="external-link">Object</a>, <a href="http\
://example.com/docs/api/java.base/java/lang/RuntimeException.html" title="class \
in java.lang" class="external-link">RuntimeException</a>&gt;.<a href="A.Inner.ht\
ml" title="class in pkg1">Inner</a>""");
}
/**

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 4720957 5020118 8026567 8038976 8184969 8164407 8182765 8205593
* 8216497
* 8216497 8369531
* @summary Test to make sure that -link and -linkoffline link to
* right files, and URLs with and without trailing slash are accepted.
* @library ../../lib
@ -73,8 +73,8 @@ public class TestLinkOption extends JavadocTester {
checkOutput("pkg/C.html", true,
"<a href=\"" + url + """
java/lang/String.html" title="class or interface in java.lang" class="external-l\
ink"><code>Link to String Class</code></a>""",
java/lang/String.html" title="class in java.lang" class="external-link"><code>Li\
nk to String Class</code></a>""",
//Make sure the parameters are formatted properly when the -link option is used.
"""
(int&nbsp;p1,
@ -84,20 +84,20 @@ public class TestLinkOption extends JavadocTester {
(int&nbsp;p1,
int&nbsp;p2,
<a href=\"""" + url + """
java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;p3)""");
java/lang/Object.html" title="class in java.lang" class="external-link">Object</a>&nbsp;p3)""");
checkOutput("pkg/B.html", true,
"""
<div class="block">A method with html tag the method <a href=\"""" + url + """
java/lang/ClassLoader.html#getSystemClassLoader--" title="class or interface in \
java.lang" class="external-link"><code><b>getSystemClassLoader()</b></code></a> \
as the parent class loader.</div>""",
java/lang/ClassLoader.html#getSystemClassLoader--" class="external-link"><code><\
b>getSystemClassLoader()</b></code></a> as the parent class loader.</div>""",
"""
<div class="block">is equivalent to invoking <code><a href="#createTempFile(java\
.lang.String,java.lang.String,java.io.File)"><code>createTempFile(prefix,&nbsp;s\
uffix,&nbsp;null)</code></a></code>.</div>""",
"<a href=\"" + url + """
java/lang/String.html" title="class or interface in java.lang" class="external-link">Link-Plain to String Class</a>""",
java/lang/String.html" title="class in java.lang" class="external-link">Link-Pla\
in to String Class</a>""",
"<code><b>getSystemClassLoader()</b></code>",
"<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code>",
"""
@ -121,8 +121,8 @@ public class TestLinkOption extends JavadocTester {
<div class="type-signature"><span class="modifiers">public abstract class </span\
><span class="element-name type-name-label">StringBuilderChild</span>
<span class="extends-implements">extends <a href=\"""" + url + """
java/lang/Object.html" title="class or interface in java.lang" class="external-l\
ink">Object</a></span></div>"""
java/lang/Object.html" title="class in java.lang" class="external-link">Object</\
a></span></div>"""
);
// Generate the documentation using -linkoffline and a relative path as the first parameter.
@ -137,7 +137,7 @@ public class TestLinkOption extends JavadocTester {
checkOutput("pkg2/C2.html", true,
"""
This is a link to <a href="../../""" + out1 + """
/pkg/C.html" title="class or interface in pkg" class="external-link"><code>Class C</code></a>."""
/pkg/C.html" title="class in pkg" class="external-link"><code>Class C</code></a>."""
);
String out3 = "out3";
@ -168,12 +168,12 @@ public class TestLinkOption extends JavadocTester {
<span class="extends-implements">extends java.lang.Object</span></div>
<div class="block">Test links.
<br>
<a href="../../out2/pkg2/C2.html" title="class or interface in pkg2" class="ext\
ernal-link"><code>link to pkg2.C2</code></a>
<a href="../../out2/pkg2/C2.html" title="class in pkg2" class="external-link"><c\
ode>link to pkg2.C2</code></a>
<br>
<a href="../../out1/mylib/lang/StringBuilderChild.html" title="class or interfa\
ce in mylib.lang" class="external-link"><code>link to mylib.lang.StringBuilderCh\
ild</code></a>.</div>
<a href="../../out1/mylib/lang/StringBuilderChild.html" title="class in mylib.la\
ng" class="external-link"><code>link to mylib.lang.StringBuilderChild</code></a>\
.</div>
"""
);
@ -193,12 +193,11 @@ public class TestLinkOption extends JavadocTester {
<span class="extends-implements">extends java.lang.Object</span></div>
<div class="block">Test links.
<br>
<a href="../../copy/out2/pkg2/C2.html" title="class or interface in pkg2" class\
="external-link"><code>link to pkg2.C2</code></a>
<a href="../../copy/out2/pkg2/C2.html" title="class in pkg2" class="external-lin\
k"><code>link to pkg2.C2</code></a>
<br>
<a href="../../copy/out1/mylib/lang/StringBuilderChild.html" title="class or in\
terface in mylib.lang" class="external-link"><code>link to mylib.lang.StringBuil\
derChild</code></a>.</div>
<a href="../../copy/out1/mylib/lang/StringBuilderChild.html" title="class in myl\
ib.lang" class="external-link"><code>link to mylib.lang.StringBuilderChild</code></a>.</div>
"""
);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, 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
@ -104,7 +104,7 @@ public class TestLinkOptionWithAutomaticModule extends JavadocTester {
checkExit(Exit.OK);
checkOutput("p/MyClass.html", true,
"""
extends <a href="http://myWebsite/lib/LibClass.html" title="class or interface i\
extends <a href="http://myWebsite/lib/LibClass.html" title="class i\
n lib" class="external-link">LibClass</a>""");
}
@ -129,7 +129,7 @@ public class TestLinkOptionWithAutomaticModule extends JavadocTester {
checkExit(Exit.OK);
checkOutput("my.module/p/MyClass.html", true,
"""
extends <a href="http://myWebsite/lib/LibClass.html" title="class or interface i\
extends <a href="http://myWebsite/lib/LibClass.html" title="class i\
n lib" class="external-link">LibClass</a>""");
}
@ -154,7 +154,7 @@ public class TestLinkOptionWithAutomaticModule extends JavadocTester {
checkExit(Exit.OK);
checkOutput("my.module/p/MyClass.html", true,
"""
extends <a href="http://myWebsite/lib/LibClass.html" title="class or interface i\
extends <a href="http://myWebsite/lib/LibClass.html" title="class i\
n lib" class="external-link">LibClass</a>""");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -79,7 +79,7 @@ public class TestLinkOptionWithModule extends JavadocTester {
checkExit(Exit.OK);
checkOutput("com.ex2/com/ex2/B.html", true,
"""
<a href="../../../../out1a/com.ex1/com/ex1/A.html" title="class or interface in com.ex1" class="external-link">A</a>""");
<a href="../../../../out1a/com.ex1/com/ex1/A.html" title="class in com.ex1" class="external-link">A</a>""");
}
@Test
@ -98,7 +98,7 @@ public class TestLinkOptionWithModule extends JavadocTester {
checkExit(Exit.OK);
checkOutput("com/ex2/B.html", true,
"""
<a href="../../../out2a/com/ex1/A.html" title="class or interface in com.ex1" class="external-link">A</a>""");
<a href="../../../out2a/com/ex1/A.html" title="class in com.ex1" class="external-link">A</a>""");
}
@Test
@ -121,7 +121,7 @@ public class TestLinkOptionWithModule extends JavadocTester {
+ "in ../out3a/ are in the unnamed module");
checkOutput("com.ex2/com/ex2/B.html", true,
"""
<a href="../../../../out3a/com/ex1/A.html" title="class or interface in com.ex1" class="external-link">A</a>""");
<a href="../../../../out3a/com/ex1/A.html" title="class in com.ex1" class="external-link">A</a>""");
}
@Test
@ -143,7 +143,7 @@ public class TestLinkOptionWithModule extends JavadocTester {
+ "in ../out4a/ are in named modules");
checkOutput("com/ex2/B.html", true,
"""
<a href="../../../out4a/com.ex1/com/ex1/A.html" title="class or interface in com.ex1" class="external-link">A</a>""");
<a href="../../../out4a/com.ex1/com/ex1/A.html" title="class in com.ex1" class="external-link">A</a>""");
}
@Test
@ -167,7 +167,7 @@ public class TestLinkOptionWithModule extends JavadocTester {
+ "in ../out5a/ are in the unnamed module");
checkOutput("com.ex2/com/ex2/B.html", true,
"""
<a href="../../../../out5a/com/ex1/A.html" title="class or interface in com.ex1" class="external-link">A</a>""");
<a href="../../../../out5a/com/ex1/A.html" title="class in com.ex1" class="external-link">A</a>""");
}
@Test
@ -193,7 +193,7 @@ public class TestLinkOptionWithModule extends JavadocTester {
+ "in ../out6a/ are in named modules");
checkOutput("com/ex2/B.html", true,
"""
<a href="../../../out6a/com.ex1/com/ex1/A.html" title="class or interface in com.ex1" class="external-link">A</a>""");
<a href="../../../out6a/com.ex1/com/ex1/A.html" title="class in com.ex1" class="external-link">A</a>""");
}
void initModulesAndPackages() throws Exception{

View File

@ -162,11 +162,12 @@ public class TestRedirectLinks extends JavadocTester {
checkExit(Exit.OK);
checkOutput("pkg/B.html", true,
"<a href=\"" + apiURL + """
/java.base/java/lang/String.html" title="class or interface in java.lang" class=\
/java.base/java/lang/String.html" title="class in java.lang" class=\
"external-link">Link-Plain to String Class</a>""");
checkOutput("pkg/C.html", true,
"<a href=\"" + apiURL + """
/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>""");
/java.base/java/lang/Object.html" title="class in java.lang" class=\
"external-link">Object</a>""");
}
private Path libApi = Path.of("libApi");
@ -272,10 +273,10 @@ public class TestRedirectLinks extends JavadocTester {
"warning: URL " + oldURL + "/element-list was redirected to " + newURL + "/element-list");
checkOutput("mC/p5/C5.html", true,
"extends <a href=\"" + oldURL + """
/mA/p1/C1.html" title="class or interface in p1" class="external-link">C1</a>""");
/mA/p1/C1.html" title="class in p1" class="external-link">C1</a>""");
checkOutput("mC/p6/C6.html", true,
"<a href=\"" + oldURL + """
/mB/p4/C4.html" title="class or interface in p4" class="external-link">C4</a>""");
/mB/p4/C4.html" title="class in p4" class="external-link">C4</a>""");
} finally {
if (oldServer != null) {
out.println("Stopping old server on " + oldServer.getAddress());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2025, 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 8216497 8297437
* @bug 8216497 8297437 8369531
* @summary javadoc should auto-link to platform classes
* @library /tools/lib ../../lib
* @modules
@ -106,15 +106,15 @@ public class TestLinkPlatform extends JavadocTester {
if (version <= 9) {
checkOutput("p/q/A.html", true,
"<a href=\"" + url + "\"",
"<a href=\"" + url + "#clone--\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#equals-java.lang.Object-\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#finalize--\" title=\"class or interface in java.lang\" class=\"external-link\">");
"<a href=\"" + url + "#clone--\" title=\"clone()\" class=\"external-link\">",
"<a href=\"" + url + "#equals-java.lang.Object-\" title=\"equals(Object)\" class=\"external-link\">",
"<a href=\"" + url + "#finalize--\" title=\"finalize()\" class=\"external-link\">");
} else {
checkOutput("p/q/A.html", true,
"<a href=\"" + url + "\"",
"<a href=\"" + url + "#clone()\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#equals(java.lang.Object)\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#finalize()\" title=\"class or interface in java.lang\" class=\"external-link\">");
"<a href=\"" + url + "#clone()\" title=\"clone()\" class=\"external-link\">",
"<a href=\"" + url + "#equals(java.lang.Object)\" title=\"equals(Object)\" class=\"external-link\">",
"<a href=\"" + url + "#finalize()\" title=\"finalize()\" class=\"external-link\">");
}
}
}
@ -136,15 +136,15 @@ public class TestLinkPlatform extends JavadocTester {
if (version <= 9) {
checkOutput("p/q/A.html", true,
"<a href=\"" + url + "\"",
"<a href=\"" + url + "#clone--\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#equals-java.lang.Object-\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#finalize--\" title=\"class or interface in java.lang\" class=\"external-link\">");
"<a href=\"" + url + "#clone--\" title=\"clone()\" class=\"external-link\">",
"<a href=\"" + url + "#equals-java.lang.Object-\" title=\"equals(Object)\" class=\"external-link\">",
"<a href=\"" + url + "#finalize--\" title=\"finalize()\" class=\"external-link\">");
} else {
checkOutput("p/q/A.html", true,
"<a href=\"" + url + "\"",
"<a href=\"" + url + "#clone()\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#equals(java.lang.Object)\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#finalize()\" title=\"class or interface in java.lang\" class=\"external-link\">");
"<a href=\"" + url + "#clone()\" title=\"clone()\" class=\"external-link\">",
"<a href=\"" + url + "#equals(java.lang.Object)\" title=\"equals(Object)\" class=\"external-link\">",
"<a href=\"" + url + "#finalize()\" title=\"finalize()\" class=\"external-link\">");
}
}
}
@ -166,15 +166,15 @@ public class TestLinkPlatform extends JavadocTester {
if (version <= 9) {
checkOutput("p/q/A.html", true,
"<a href=\"" + url + "\"",
"<a href=\"" + url + "#clone--\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#equals-java.lang.Object-\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#finalize--\" title=\"class or interface in java.lang\" class=\"external-link\">");
"<a href=\"" + url + "#clone--\" title=\"clone()\" class=\"external-link\">",
"<a href=\"" + url + "#equals-java.lang.Object-\" title=\"equals(Object)\" class=\"external-link\">",
"<a href=\"" + url + "#finalize--\" title=\"finalize()\" class=\"external-link\">");
} else {
checkOutput("p/q/A.html", true,
"<a href=\"" + url + "\"",
"<a href=\"" + url + "#clone()\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#equals(java.lang.Object)\" title=\"class or interface in java.lang\" class=\"external-link\">",
"<a href=\"" + url + "#finalize()\" title=\"class or interface in java.lang\" class=\"external-link\">");
"<a href=\"" + url + "#clone()\" title=\"clone()\" class=\"external-link\">",
"<a href=\"" + url + "#equals(java.lang.Object)\" title=\"equals(Object)\" class=\"external-link\">",
"<a href=\"" + url + "#finalize()\" title=\"finalize()\" class=\"external-link\">");
}
}
}

View File

@ -107,20 +107,15 @@ public class TestLinkTagletWithModule extends JavadocTester {
<div class="block"><a href="../../../../../out1/m1/module-summary.html" class="external-link"><code>m1</code></a>
<a href="../../../../../out1/m1/module-summary.html" class="external-link"><code>m1</code></a>
<a href="../../../../../out1/m1/com/m1/lib/package-summary.html" class="external-link"><code>package link</code></a>
<a href="../../../../../out1/m1/com/m1/lib/Lib.html" title="class or interface in com.m1.lib"\
class="external-link"><code>Lib</code></a>
<a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" title="class or\
interface in com.m1.lib" class="external-link"><code>Lib.method(String)</code></a>
<a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" title="class or\
interface in com.m1.lib" class="external-link"><code>Lib.method(String)</code></a>
<a href="../../../../../out1/m1/com/m1/lib/Lib.html" title="class in com.m1.lib" class="external-link"><code>Lib</code></a>
<a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" class="external-link"><code>Lib.method(String)</code></a>
<a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" class="external-link"><code>Lib.method(String)</code></a>
<a href="../../../../../out1/m2/module-summary.html" class="external-link">m2</a>
<a href="../../../../../out1/m2/module-summary.html" class="external-link">m2</a>
<a href="../../../../../out1/m2/com/m2/lib/package-summary.html" class="external-link">m2/com.m2.lib</a>
<a href="../../../../../out1/m2/com/m2/lib/Lib.html" title="class or interface in com.m2.lib" class="external-link">Lib</a>
<a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" title="class or\
interface in com.m2.lib" class="external-link">class link</a>
<a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" title="class or\
interface in com.m2.lib" class="external-link">Lib.method(String)</a></div>
<a href="../../../../../out1/m2/com/m2/lib/Lib.html" title="class in com.m2.lib" class="external-link">Lib</a>
<a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" class="external-link">class link</a>
<a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" class="external-link">Lib.method(String)</a></div>
""");
}
@ -164,9 +159,9 @@ public class TestLinkTagletWithModule extends JavadocTester {
<div class="block"><a href="../../../../out1/com.ex1/com/ex1/package-summary.html" class="external-link"><code>package link</code></a>
<a href="../../../../out1/com.ex1/module-summary.html" class="external-link"><code>module link</code></a>
<a href="../../../../out1/com.ex1/com/ex1/package-summary.html" class="external-link"><code>com.ex1/com.ex1</code></a>
<a href="../../../../out1/com.ex1/com/ex1/A.html" title="class or interface in com.ex1" class="external-link"><code>class link</code></a>
<a href="../../../../out1/com.ex1/com/ex1/A.html#m()" title="class or interface in com.ex1" class="external-link"><code>A.m()</code></a>
<a href="../../../../out1/com.ex1/com/ex1/A.html#m()" title="class or interface in com.ex1" class="external-link"><code>A.m()</code></a>
<a href="../../../../out1/com.ex1/com/ex1/A.html" title="class in com.ex1" class="external-link"><code>class link</code></a>
<a href="../../../../out1/com.ex1/com/ex1/A.html#m()" class="external-link"><code>A.m()</code></a>
<a href="../../../../out1/com.ex1/com/ex1/A.html#m()" class="external-link"><code>A.m()</code></a>
<a href="package-summary.html"><code>com.ex2</code></a>
<a href="../../module-summary.html"><code>com.ex2</code></a></div>
""");

View File

@ -245,19 +245,19 @@ public class TestMarkdownLinks extends JavadocTester {
"/api/java.base/java/util/package-summary.html\" class=\"external-link\"><code>java.util</code></a>",
"class <a href=\"https://",
"/api/java.base/java/lang/String.html\" title=\"class or interface in java.lang\" class=\"external-link\"><code>String</code></a>",
"/api/java.base/java/lang/String.html\" title=\"class in java.lang\" class=\"external-link\"><code>String</code></a>",
"interface <a href=\"https://",
"/api/java.base/java/lang/Runnable.html\" title=\"class or interface in java.lang\" class=\"external-link\"><code>Runnable</code></a>",
"/api/java.base/java/lang/Runnable.html\" title=\"interface in java.lang\" class=\"external-link\"><code>Runnable</code></a>",
"a field <a href=\"https://",
"/api/java.base/java/lang/String.html#CASE_INSENSITIVE_ORDER\" title=\"class or interface in java.lang\" class=\"external-link\"><code>String.CASE_INSENSITIVE_ORDER</code></a>",
"/api/java.base/java/lang/String.html#CASE_INSENSITIVE_ORDER\" class=\"external-link\"><code>String.CASE_INSENSITIVE_ORDER</code></a>",
"a constructor <a href=\"https://",
"/api/java.base/java/lang/String.html#%3Cinit%3E()\" title=\"class or interface in java.lang\" class=\"external-link\"><code>String()</code></a></li>",
"/api/java.base/java/lang/String.html#%3Cinit%3E()\" class=\"external-link\"><code>String()</code></a></li>",
"a method <a href=\"https://",
"/api/java.base/java/lang/String.html#chars()\" title=\"class or interface in java.lang\" class=\"external-link\"><code>String.chars()</code></a>");
"/api/java.base/java/lang/String.html#chars()\" class=\"external-link\"><code>String.chars()</code></a>");
}
/// Test the ability to include array elements in method signatures for
@ -346,4 +346,4 @@ public class TestMarkdownLinks extends JavadocTester {
</dd>""");
}
}
}

View File

@ -1331,8 +1331,8 @@ public class TestModules extends JavadocTester {
checkOutput("moduleB/testpkg3mdlB/package-summary.html", true,
"""
<a href="https://docs.oracle.com/javase/9/docs/api/java.base/java/lang/String.ht\
ml" title="class or interface in java.lang" class="external-link"><code>Link to \
String Class</code></a>""");
ml" title="class in java.lang" class="external-link"><code>Link to String Class<\
/code></a>""");
checkOutput("moduleB/testpkg3mdlB/package-summary.html", true,
"""
<a href="https://docs.oracle.com/javase/9/docs/api/java.base/java/lang/package-s\

View File

@ -63,9 +63,9 @@ public class TestPreview extends JavadocTester {
checkOutput("m/pkg/TestPreviewDeclarationUse.html", true,
"<code><a href=\"TestPreviewDeclaration.html\" title=\"interface in pkg\">TestPreviewDeclaration</a></code>");
checkOutput("m/pkg/TestPreviewAPIUse.html", true,
"<a href=\"" + doc + "java.base/preview/Core.html\" title=\"class or interface in preview\" class="
"<a href=\"" + doc + "java.base/preview/Core.html\" title=\"class in preview\" class="
+ "\"external-link\">Core</a><sup class=\"preview-mark\"><a href=\"" + doc + "java.base/pr"
+ "eview/Core.html#preview-preview.Core\" title=\"class or interface in preview\" class=\""
+ "eview/Core.html#preview-preview.Core\" class=\""
+ "external-link\">PREVIEW</a>");
checkOutput("m/pkg/DocAnnotation.html", true,
"<span class=\"modifiers\">public @interface </span><span class=\"element-name type-name-label\">DocAnnotation</span>");
@ -254,7 +254,7 @@ public class TestPreview extends JavadocTester {
checkOutput("api2/api/API.html", true,
"<p><a href=\"#test()\"><code>test()</code></a></p>",
"<p><a href=\"#testNoPreviewInSig()\"><code>testNoPreviewInSig()</code></a></p>",
"title=\"class or interface in java.util\" class=\"external-link\">List</a>&lt;<a href=\"API.h"
"title=\"interface in java.util\" class=\"external-link\">List</a>&lt;<a href=\"API.h"
+ "tml\" title=\"class in api\">API</a><sup class=\"preview-mark\"><a href=\"#preview-"
+ "api.API\">PREVIEW</a></sup>&gt;");
checkOutput("api2/api/API2.html", true,

View File

@ -113,19 +113,15 @@ public class TestSeeTagWithModule extends JavadocTester {
<li><a href="../../../../../out1/m1/module-summary.html" class="external-link"><code>m1</code></a></li>
<li><a href="../../../../../out1/m1/module-summary.html" class="external-link"><code>m1</code></a></li>
<li><a href="../../../../../out1/m1/com/m1/lib/package-summary.html" class="external-link"><code>m1/com.m1.lib</code></a></li>
<li><a href="../../../../../out1/m1/com/m1/lib/Lib.html" title="class or interface in com.m1.lib" class="external-link"><code>Lib</code></a></li>
<li><a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" title="class or \
interface in com.m1.lib" class="external-link"><code>Lib.method(String)</code></a></li>
<li><a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" title="class or \
interface in com.m1.lib" class="external-link"><code>Lib.method(String)</code></a></li>
<li><a href="../../../../../out1/m1/com/m1/lib/Lib.html" title="class in com.m1.lib" class="external-link"><code>Lib</code></a></li>
<li><a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" class="external-link"><code>Lib.method(String)</code></a></li>
<li><a href="../../../../../out1/m1/com/m1/lib/Lib.html#method(java.lang.String)" class="external-link"><code>Lib.method(String)</code></a></li>
<li><a href="../../../../../out1/m2/module-summary.html" class="external-link"><code>m2</code></a></li>
<li><a href="../../../../../out1/m2/module-summary.html" class="external-link"><code>m2</code></a></li>
<li><a href="../../../../../out1/m2/com/m2/lib/package-summary.html" class="external-link"><code>m2/com.m2.lib</code></a></li>
<li><a href="../../../../../out1/m2/com/m2/lib/Lib.html" title="class or interface in com.m2.lib" class="external-link"><code>Lib</code></a></li>
<li><a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" title="class or \
interface in com.m2.lib" class="external-link"><code>Lib.method(String)</code></a></li>
<li><a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" title="class or \
interface in com.m2.lib" class="external-link"><code>Lib.method(String)</code></a></li>
<li><a href="../../../../../out1/m2/com/m2/lib/Lib.html" title="class in com.m2.lib" class="external-link"><code>Lib</code></a></li>
<li><a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" class="external-link"><code>Lib.method(String)</code></a></li>
<li><a href="../../../../../out1/m2/com/m2/lib/Lib.html#method(java.lang.String)" class="external-link"><code>Lib.method(String)</code></a></li>
""");
}
@ -175,9 +171,9 @@ public class TestSeeTagWithModule extends JavadocTester {
<li><a href="../../../../out1/com.ex1/com/ex1/package-summary.html" class="external-link"><code>com.ex1</code></a></li>
<li><a href="../../../../out1/com.ex1/module-summary.html" class="external-link"><code>com.ex1</code></a></li>
<li><a href="../../../../out1/com.ex1/com/ex1/package-summary.html" class="external-link"><code>com.ex1/com.ex1</code></a></li>
<li><a href="../../../../out1/com.ex1/com/ex1/A.html" title="class or interface in com.ex1" class="external-link"><code>A</code></a></li>
<li><a href="../../../../out1/com.ex1/com/ex1/A.html#m()" title="class or interface in com.ex1" class="external-link"><code>A.m()</code></a></li>
<li><a href="../../../../out1/com.ex1/com/ex1/A.html#m()" title="class or interface in com.ex1" class="external-link"><code>A.m()</code></a></li>
<li><a href="../../../../out1/com.ex1/com/ex1/A.html" title="class in com.ex1" class="external-link"><code>A</code></a></li>
<li><a href="../../../../out1/com.ex1/com/ex1/A.html#m()" class="external-link"><code>A.m()</code></a></li>
<li><a href="../../../../out1/com.ex1/com/ex1/A.html#m()" class="external-link"><code>A.m()</code></a></li>
<li><a href="package-summary.html"><code>com.ex2</code></a></li>
<li><a href="../../module-summary.html"><code>com.ex2</code></a></li>
""");

View File

@ -1123,7 +1123,7 @@ First line // @highlight :
}
String output = fileManager.getFileString(DOCUMENTATION_OUTPUT, "A.html");
// use the [^<>] regex to select HTML elements that immediately enclose "content"
Matcher m = Pattern.compile("(?is)(<a href=\"[^<>]*\" title=\"[^<>]*\" class=\"[^<>]*\">)"
Matcher m = Pattern.compile("(?is)(<a href=\"[^<>]*\" class=\"[^<>]*\">)"
+ LABEL_PLACEHOLDER + "(</a>)").matcher(output);
if (!m.find()) {
throw new IOException(output);

View File

@ -59,7 +59,7 @@ public class TestTitleInHref extends JavadocTester {
<a href="Interface.html" title="interface in pkg">""",
//Test to make sure that the title shows up in cross link shows up
"<a href=\"" + uri + """
/java/io/File.html" title="class or interface in java.io" class="external-link">\
/java/io/File.html" title="class in java.io" class="external-link">\
<code>This is a cross link to class File</code></a>""");
}
}