Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
b995fb4f
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b995fb4f
编写于
4月 04, 2011
作者:
A
alanb
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
a67dbb67
99631b31
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
203 addition
and
87 deletion
+203
-87
src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
.../tools/doclets/formats/html/AnnotationTypeWriterImpl.java
+7
-4
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
...s/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
+7
-4
src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
...s/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
+1
-4
src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java
...sses/com/sun/tools/doclets/formats/html/LinkInfoImpl.java
+1
-5
test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
...om/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
+3
-4
test/com/sun/javadoc/testHref/TestHref.java
test/com/sun/javadoc/testHref/TestHref.java
+3
-4
test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
.../testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
+4
-4
test/com/sun/javadoc/testLinkOption/TestLinkOption.java
test/com/sun/javadoc/testLinkOption/TestLinkOption.java
+3
-4
test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
...adoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
+44
-36
test/com/sun/javadoc/testTypeParams/TestTypeParameters.java
test/com/sun/javadoc/testTypeParams/TestTypeParameters.java
+40
-18
test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java
test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java
+37
-0
test/com/sun/javadoc/testTypeParams/pkg/Foo4.java
test/com/sun/javadoc/testTypeParams/pkg/Foo4.java
+26
-0
test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java
test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java
+27
-0
未找到文件。
src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
浏览文件 @
b995fb4f
...
...
@@ -216,12 +216,15 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
pre
.
addContent
(
modifiers
);
LinkInfoImpl
linkInfo
=
new
LinkInfoImpl
(
LinkInfoImpl
.
CONTEXT_CLASS_SIGNATURE
,
annotationType
,
false
);
Content
name
=
new
RawHtml
(
annotationType
.
name
()
+
getTypeParameterLinks
(
linkInfo
));
Content
annotationName
=
new
StringContent
(
annotationType
.
name
());
Content
parameterLinks
=
new
RawHtml
(
getTypeParameterLinks
(
linkInfo
));
if
(
configuration
().
linksource
)
{
addSrcLink
(
annotationType
,
name
,
pre
);
addSrcLink
(
annotationType
,
annotationName
,
pre
);
pre
.
addContent
(
parameterLinks
);
}
else
{
pre
.
addContent
(
HtmlTree
.
STRONG
(
name
));
Content
span
=
HtmlTree
.
SPAN
(
HtmlStyle
.
strong
,
annotationName
);
span
.
addContent
(
parameterLinks
);
pre
.
addContent
(
span
);
}
annotationInfoTree
.
addContent
(
pre
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
浏览文件 @
b995fb4f
...
...
@@ -228,12 +228,15 @@ public class ClassWriterImpl extends SubWriterHolderWriter
LinkInfoImpl
.
CONTEXT_CLASS_SIGNATURE
,
classDoc
,
false
);
//Let's not link to ourselves in the signature.
linkInfo
.
linkToSelf
=
false
;
Content
name
=
new
RawHtml
(
classDoc
.
name
()
+
getTypeParameterLinks
(
linkInfo
));
Content
className
=
new
StringContent
(
classDoc
.
name
());
Content
parameterLinks
=
new
RawHtml
(
getTypeParameterLinks
(
linkInfo
));
if
(
configuration
().
linksource
)
{
addSrcLink
(
classDoc
,
name
,
pre
);
addSrcLink
(
classDoc
,
className
,
pre
);
pre
.
addContent
(
parameterLinks
);
}
else
{
pre
.
addContent
(
HtmlTree
.
STRONG
(
name
));
Content
span
=
HtmlTree
.
SPAN
(
HtmlStyle
.
strong
,
className
);
span
.
addContent
(
parameterLinks
);
pre
.
addContent
(
span
);
}
if
(!
isInterface
)
{
Type
superclass
=
Util
.
getFirstVisibleSuperClass
(
classDoc
,
...
...
src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
浏览文件 @
b995fb4f
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
1
, 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
...
...
@@ -69,9 +69,6 @@ public class LinkFactoryImpl extends LinkFactory {
StringBuffer
label
=
new
StringBuffer
(
classLinkInfo
.
getClassLinkLabel
(
m_writer
.
configuration
));
classLinkInfo
.
displayLength
+=
label
.
length
();
if
(
noLabel
&&
classLinkInfo
.
excludeTypeParameterLinks
)
{
label
.
append
(
getTypeParameterLinks
(
linkInfo
).
toString
());
}
Configuration
configuration
=
ConfigurationImpl
.
getInstance
();
LinkOutputImpl
linkOutput
=
new
LinkOutputImpl
();
if
(
classDoc
.
isIncluded
())
{
...
...
src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java
浏览文件 @
b995fb4f
/*
* Copyright (c) 2003, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -408,10 +408,6 @@ public class LinkInfoImpl extends LinkInfo {
case
CONTEXT_PACKAGE:
case
CONTEXT_CLASS_USE:
excludeTypeBoundsLinks
=
true
;
excludeTypeParameterLinks
=
true
;
break
;
case
CONTEXT_CLASS_HEADER:
case
CONTEXT_CLASS_SIGNATURE:
excludeTypeParameterLinks
=
true
;
...
...
test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
浏览文件 @
b995fb4f
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
1
, 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
...
...
@@ -27,8 +27,7 @@
* @summary <DESC>
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestDeprecatedDocs
* @build JavadocTester TestDeprecatedDocs
* @run main TestDeprecatedDocs
*/
...
...
@@ -77,7 +76,7 @@ public class TestDeprecatedDocs extends JavadocTester {
{
TARGET_FILE
,
"pkg.DeprecatedClassByAnnotation.field"
},
{
TARGET_FILE2
,
"<pre>@Deprecated"
+
NL
+
"public class <s
trong>DeprecatedClassByAnnotation</strong
>"
+
NL
+
"public class <s
pan class=\"strong\">DeprecatedClassByAnnotation</span
>"
+
NL
+
"extends java.lang.Object</pre>"
},
{
TARGET_FILE2
,
"<pre>@Deprecated"
+
NL
+
...
...
test/com/sun/javadoc/testHref/TestHref.java
浏览文件 @
b995fb4f
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
1
, 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
...
...
@@ -27,8 +27,7 @@
* @summary Verify that spaces do not appear in hrefs and anchors.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestHref
* @build JavadocTester TestHref
* @run main TestHref
*/
...
...
@@ -81,7 +80,7 @@ public class TestHref extends JavadocTester {
//Signature does not link to the page itself.
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"C4.html"
,
"public abstract class <s
trong>C4<E extends C4<E>></strong
>"
"public abstract class <s
pan class=\"strong\">C4<E extends C4<E>></span
>"
},
};
private
static
final
String
[][]
NEGATED_TEST
=
...
...
test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
浏览文件 @
b995fb4f
/*
* Copyright (c) 2009, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 201
1
, 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
...
...
@@ -29,8 +29,7 @@
* @summary This test verifies the nesting of definition list tags.
* @author Bhavesh Patel
* @library ../lib/
* @build JavadocTester
* @build TestHtmlDefinitionListTag
* @build JavadocTester TestHtmlDefinitionListTag
* @run main TestHtmlDefinitionListTag
*/
...
...
@@ -43,7 +42,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// Optional Element should print properly nested definition list tags
// for default value.
private
static
final
String
[][]
TEST_ALL
=
{
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"C1.html"
,
"<pre>public class <strong>C1</strong>"
+
NL
+
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"C1.html"
,
"<pre>public class "
+
"<span class=\"strong\">C1</span>"
+
NL
+
"extends java.lang.Object"
+
NL
+
"implements java.io.Serializable</pre>"
},
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"C4.html"
,
"<dl>"
+
NL
+
"<dt>Default:</dt>"
+
NL
+
"<dd>true</dd>"
+
NL
+
...
...
test/com/sun/javadoc/testLinkOption/TestLinkOption.java
浏览文件 @
b995fb4f
/*
* Copyright (c) 2002, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
1
, 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
...
...
@@ -28,8 +28,7 @@
* right files.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestLinkOption
* @build JavadocTester TestLinkOption
* @run main TestLinkOption
*/
...
...
@@ -62,7 +61,7 @@ public class TestLinkOption extends JavadocTester {
"Object</a> p3)"
},
{
BUG_ID
+
"-1"
+
FS
+
"java"
+
FS
+
"lang"
+
FS
+
"StringBuilderChild.html"
,
"<pre>public abstract class <s
trong>StringBuilderChild</strong
>"
+
NL
+
"<pre>public abstract class <s
pan class=\"strong\">StringBuilderChild</span
>"
+
NL
+
"extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" "
+
"title=\"class or interface in java.lang\">Object</a></pre>"
},
...
...
test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
浏览文件 @
b995fb4f
...
...
@@ -23,14 +23,13 @@
/*
* @test
* @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314
* @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314
7010344
* @summary Run Javadoc on a set of source files that demonstrate new
* language features. Check the output to ensure that the new
* language features are properly documented.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestNewLanguageFeatures
* @build JavadocTester TestNewLanguageFeatures
* @run main TestNewLanguageFeatures
*/
...
...
@@ -53,9 +52,10 @@ public class TestNewLanguageFeatures extends JavadocTester {
//Make sure enum header is correct.
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"Coin.html"
,
"Enum Coin</h2>"
},
//Make sure enum signature is correct.
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"Coin.html"
,
"<pre>public enum <strong>Coin</strong>"
+
NL
+
"extends java.lang.Enum<<a href=\"../pkg/Coin.html\" "
+
"title=\"enum in pkg\">Coin</a>></pre>"
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"Coin.html"
,
"<pre>public enum "
+
"<span class=\"strong\">Coin</span>"
+
NL
+
"extends java.lang.Enum<<a href=\"../pkg/Coin.html\" "
+
"title=\"enum in pkg\">Coin</a>></pre>"
},
//Check for enum constant section
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"Coin.html"
,
"<caption><span>Enum Constants"
+
...
...
@@ -118,8 +118,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
//Signature of subclass that has type parameters.
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"TypeParameterSubClass.html"
,
"<pre>public class <s
trong
>TypeParameterSubClass<T extends "
+
"java.lang.String></s
trong
>"
+
NL
+
"extends "
+
"<pre>public class <s
pan class=\"strong\"
>TypeParameterSubClass<T extends "
+
"java.lang.String></s
pan
>"
+
NL
+
"extends "
+
"<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">"
+
"TypeParameterSuperClass</a><T></pre>"
},
...
...
@@ -168,7 +168,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
"Annotation Type AnnotationType</h2>"
},
//Make sure the signature is correct.
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"AnnotationType.html"
,
"public @interface <s
trong>AnnotationType</strong
>"
},
"public @interface <s
pan class=\"strong\">AnnotationType</span
>"
},
//Make sure member summary headings are correct.
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"AnnotationType.html"
,
"<h3>Required Element Summary</h3>"
},
...
...
@@ -198,8 +198,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
"<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>"
+
"=\"Class Annotation\","
+
NL
+
" <a href=\"../pkg/AnnotationType.html#required()\">"
+
"required</a>=1994)"
+
NL
+
"public class <s
trong
>"
+
"AnnotationTypeUsage</s
trong
>"
+
NL
+
"extends java.lang.Object</pre>"
},
"required</a>=1994)"
+
NL
+
"public class <s
pan class=\"strong\"
>"
+
"AnnotationTypeUsage</s
pan
>"
+
NL
+
"extends java.lang.Object</pre>"
},
//FIELD
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"AnnotationTypeUsage.html"
,
...
...
@@ -299,7 +299,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"B.html"
,
"<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"
},
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"B.html"
,
"public interface <s
trong>B</strong
></pre>"
},
"public interface <s
pan class=\"strong\">B</span
></pre>"
},
//==============================================================
...
...
@@ -320,9 +320,11 @@ public class TestNewLanguageFeatures extends JavadocTester {
"Foo</a></span><span class=\"tabEnd\"> </span></caption>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo.html"
,
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/"
+
"ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1"
+
"<T extends Foo & Foo2></a></strong></code> </td>"
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" "
+
"title=\"class in pkg2\">ClassUseTest1</a><T extends "
+
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
+
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+
"Foo2</a>></strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo.html"
,
"<caption><span>Methods in <a href=\"../../pkg2/"
+
...
...
@@ -370,10 +372,11 @@ public class TestNewLanguageFeatures extends JavadocTester {
"</span></caption>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo2.html"
,
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/"
+
"ClassUseTest1.html\" title=\"class in pkg2\">"
+
"ClassUseTest1<T extends Foo & Foo2></a></strong>"
+
"</code> </td>"
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" "
+
"title=\"class in pkg2\">ClassUseTest1</a><T extends "
+
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
+
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+
"Foo2</a>></strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo2.html"
,
"<caption><span>Methods in <a href=\"../../pkg2/"
+
...
...
@@ -398,10 +401,11 @@ public class TestNewLanguageFeatures extends JavadocTester {
" </span></caption>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"ParamTest.html"
,
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/"
+
"ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2<T "
+
"extends ParamTest<<a href=\"../../pkg2/Foo3.html\" title=\"class "
+
"in pkg2\">Foo3</a>>></a></strong></code> </td>"
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" "
+
"title=\"class in pkg2\">ClassUseTest2</a><T extends "
+
"<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">"
+
"ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">"
+
"Foo3</a>>></strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"ParamTest.html"
,
"<caption><span>Methods in <a href=\"../../pkg2/"
+
...
...
@@ -452,11 +456,11 @@ public class TestNewLanguageFeatures extends JavadocTester {
"Foo3</a></span><span class=\"tabEnd\"> </span></caption>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo3.html"
,
"<td class=\"colLast\"><code><strong><a href=\"../../"
+
"
pkg2/ClassUseTest2.html\" title=\"class in pkg2\">
"
+
"
ClassUseTest2<T extends ParamTest<<a href=\"../../
"
+
"
pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</a>>>
"
+
"
</a>
</strong></code> </td>"
"<td class=\"colLast\"><code><strong><a href=\"../../
pkg2/ClassUseTest2.html\"
"
+
"
title=\"class in pkg2\">ClassUseTest2</a><T extends
"
+
"
<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">
"
+
"
ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">
"
+
"
Foo3</a>>>
</strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo3.html"
,
"<caption><span>Methods in <a href=\"../../pkg2/"
+
...
...
@@ -496,10 +500,12 @@ public class TestNewLanguageFeatures extends JavadocTester {
" </span></caption>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"ParamTest2.html"
,
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/"
+
"ClassUseTest3.html\" title=\"class in pkg2\">"
+
"ClassUseTest3<T extends ParamTest2<java.util.List"
+
"<? extends Foo4>>></a></strong></code> </td>"
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" "
+
"title=\"class in pkg2\">ClassUseTest3</a><T extends "
+
"<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+
"ParamTest2</a><java.util.List<? extends "
+
"<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">"
+
"Foo4</a>>>></strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"ParamTest2.html"
,
"<caption><span>Methods in <a href=\"../../pkg2/"
+
...
...
@@ -532,10 +538,12 @@ public class TestNewLanguageFeatures extends JavadocTester {
"</span></caption>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo4.html"
,
"<td class=\"colLast\"><code><strong><a href=\"../../"
+
"pkg2/ClassUseTest3.html\" title=\"class in pkg2\">"
+
"ClassUseTest3<T extends ParamTest2<java.util.List"
+
"<? extends Foo4>>></a></strong></code> </td>"
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" "
+
"title=\"class in pkg2\">ClassUseTest3</a><T extends "
+
"<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
+
"ParamTest2</a><java.util.List<? extends "
+
"<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">"
+
"Foo4</a>>>></strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo4.html"
,
"<caption><span>Methods in <a href=\"../../pkg2/"
+
...
...
test/com/sun/javadoc/testTypeParams/TestTypeParameters.java
浏览文件 @
b995fb4f
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
1
, 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,55 +23,77 @@
/*
* @test
* @bug 4927167 4974929
* @bug 4927167 4974929
7010344
* @summary When the type parameters are more than 10 characters in length,
* make sure there is a line break between type params and return type
* in member summary.
* in member summary. Also, test for type parameter links in package-summary and
* class-use pages. The class/annotation pages should check for type
* parameter links in the class/annotation signature section when -linksource is set.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestTypeParameters
* @build JavadocTester TestTypeParameters
* @run main TestTypeParameters
*/
public
class
TestTypeParameters
extends
JavadocTester
{
//Test information.
private
static
final
String
BUG_ID
=
"4927167-4974929"
;
private
static
final
String
BUG_ID
=
"4927167-4974929
-7010344
"
;
//Javadoc arguments.
private
static
final
String
[]
ARGS
=
new
String
[]
{
"-d"
,
BUG_ID
,
"-source"
,
"1.5"
,
"-sourcepath"
,
SRC_DIR
,
"pkg"
private
static
final
String
[]
ARGS1
=
new
String
[]{
"-d"
,
BUG_ID
,
"-use"
,
"-source"
,
"1.5"
,
"-sourcepath"
,
SRC_DIR
,
"pkg"
};
private
static
final
String
[]
ARGS2
=
new
String
[]{
"-d"
,
BUG_ID
,
"-linksource"
,
"-source"
,
"1.5"
,
"-sourcepath"
,
SRC_DIR
,
"pkg"
};
//Input for string search tests.
private
static
final
String
[][]
TEST
=
{
private
static
final
String
[][]
TEST1
=
{
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"C.html"
,
"<td class=\"colFirst\"><code><W extends java.lang.String,V extends "
+
"java.util.List> <br>java.lang.Object</code></td>"
},
"java.util.List> <br>java.lang.Object</code></td>"
},
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"C.html"
,
"<code><T> java.lang.Object</code>"
},
"<code><T> java.lang.Object</code>"
},
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"package-summary.html"
,
"C<E extends Parent>"
},
"C</a><E extends <a href=\"../pkg/Parent.html\" "
+
"title=\"class in pkg\">Parent</a>>"
},
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"class-use"
+
FS
+
"Foo4.html"
,
"<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">"
+
"ClassUseTest3</a><T extends <a href=\"../../pkg/ParamTest2.html\" "
+
"title=\"class in pkg\">ParamTest2</a><java.util.List<? extends "
+
"<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>"
},
//Nested type parameters
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"C.html"
,
"<a name=\"formatDetails(java.util.Collection, java.util.Collection)\">"
+
NL
+
"<!-- -->"
+
NL
+
"</a>"
},
"</a>"
},
};
private
static
final
String
[][]
TEST2
=
{
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"ClassUseTest3.html"
,
"public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">"
+
"ClassUseTest3</a><T extends <a href=\"../pkg/ParamTest2.html\" "
+
"title=\"class in pkg\">ParamTest2</a><java.util.List<? extends "
+
"<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>"
}
};
private
static
final
String
[][]
NEGATED_TEST
=
NO_TEST
;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public
static
void
main
(
String
[]
args
)
{
TestTypeParameters
tester
=
new
TestTypeParameters
();
run
(
tester
,
ARGS
,
TEST
,
NEGATED_TEST
);
run
(
tester
,
ARGS1
,
TEST1
,
NEGATED_TEST
);
run
(
tester
,
ARGS2
,
TEST2
,
NEGATED_TEST
);
tester
.
printSummary
();
}
...
...
test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java
0 → 100644
浏览文件 @
b995fb4f
/*
* Copyright (c) 2011, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
pkg
;
import
java.util.*
;
public
class
ClassUseTest3
<
T
extends
ParamTest2
<
List
<?
extends
Foo4
>>>
{
public
ClassUseTest3
(
Set
<
Foo4
>
p
)
{}
public
<
T
extends
ParamTest2
<
List
<?
extends
Foo4
>>>
ParamTest2
<
List
<?
extends
Foo4
>>
method
(
T
t
)
{
return
null
;
}
public
void
method
(
Set
<
Foo4
>
p
)
{}
}
test/com/sun/javadoc/testTypeParams/pkg/Foo4.java
0 → 100644
浏览文件 @
b995fb4f
/*
* Copyright (c) 2011, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
pkg
;
public
class
Foo4
{}
test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java
0 → 100644
浏览文件 @
b995fb4f
/*
* Copyright (c) 2011, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
pkg
;
public
class
ParamTest2
<
E
>
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录