Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
452b7aea
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看板
提交
452b7aea
编写于
5月 02, 2011
作者:
B
bpatel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6492694: @deprecated tag doesn't work in package-info files.
Reviewed-by: jjg
上级
0e2e6820
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
608 addition
and
108 deletion
+608
-108
src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java
...es/com/sun/tools/doclets/formats/html/ClassUseWriter.java
+11
-2
src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java
.../sun/tools/doclets/formats/html/DeprecatedListWriter.java
+19
-13
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
...lasses/com/sun/tools/doclets/formats/html/HtmlDoclet.java
+21
-17
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
.../com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+38
-0
src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java
...om/sun/tools/doclets/formats/html/PackageFrameWriter.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java
...n/tools/doclets/formats/html/PackageIndexFrameWriter.java
+5
-2
src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java
...om/sun/tools/doclets/formats/html/PackageIndexWriter.java
+2
-0
src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java
.../com/sun/tools/doclets/formats/html/PackageUseWriter.java
+7
-2
src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java
...com/sun/tools/doclets/formats/html/PackageWriterImpl.java
+27
-4
src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java
...sun/tools/doclets/formats/html/SourceToHTMLConverter.java
+17
-4
src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java
...lasses/com/sun/tools/doclets/formats/html/TreeWriter.java
+6
-2
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
.../com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
+3
-1
src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties
.../tools/doclets/formats/html/resources/standard.properties
+2
-0
src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
...com/sun/tools/doclets/internal/toolkit/Configuration.java
+10
-7
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
...n/tools/doclets/internal/toolkit/resources/stylesheet.css
+10
-0
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/DeprecatedTaglet.java
...ls/doclets/internal/toolkit/taglets/DeprecatedTaglet.java
+1
-8
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java
.../tools/doclets/internal/toolkit/util/ClassDocCatalog.java
+11
-6
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java
...om/sun/tools/doclets/internal/toolkit/util/ClassTree.java
+6
-2
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java
...clets/internal/toolkit/util/DeprecatedAPIListBuilder.java
+34
-24
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java
...sun/tools/doclets/internal/toolkit/util/IndexBuilder.java
+12
-2
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java
...ools/doclets/internal/toolkit/util/PackageListWriter.java
+9
-6
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java
...ses/com/sun/tools/doclets/internal/toolkit/util/Util.java
+6
-2
test/com/sun/javadoc/testPackageDeprecation/C2.java
test/com/sun/javadoc/testPackageDeprecation/C2.java
+55
-0
test/com/sun/javadoc/testPackageDeprecation/FooDepr.java
test/com/sun/javadoc/testPackageDeprecation/FooDepr.java
+34
-0
test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java
...avadoc/testPackageDeprecation/TestPackageDeprecation.java
+103
-0
test/com/sun/javadoc/testPackageDeprecation/pkg/A.java
test/com/sun/javadoc/testPackageDeprecation/pkg/A.java
+35
-0
test/com/sun/javadoc/testPackageDeprecation/pkg1/ClassUseTest1.java
...un/javadoc/testPackageDeprecation/pkg1/ClassUseTest1.java
+31
-0
test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo.java
test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo.java
+36
-0
test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo2.java
test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo2.java
+26
-0
test/com/sun/javadoc/testPackageDeprecation/pkg1/package-info.java
...sun/javadoc/testPackageDeprecation/pkg1/package-info.java
+28
-0
test/com/sun/javadoc/testSubTitle/TestSubTitle.java
test/com/sun/javadoc/testSubTitle/TestSubTitle.java
+1
-2
未找到文件。
src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java
浏览文件 @
452b7aea
...
...
@@ -149,11 +149,20 @@ public class ClassUseWriter extends SubWriterHolderWriter {
ClassUseMapper
mapper
=
new
ClassUseMapper
(
configuration
.
root
,
classtree
);
ClassDoc
[]
classes
=
configuration
.
root
.
classes
();
for
(
int
i
=
0
;
i
<
classes
.
length
;
i
++)
{
ClassUseWriter
.
generate
(
configuration
,
mapper
,
classes
[
i
]);
// If -nodeprecated option is set and the containing package is marked
// as deprecated, do not generate the class-use page. We will still generate
// the class-use page if the class is marked as deprecated but the containing
// package is not since it could still be linked from that package-use page.
if
(!(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
classes
[
i
].
containingPackage
())))
ClassUseWriter
.
generate
(
configuration
,
mapper
,
classes
[
i
]);
}
PackageDoc
[]
pkgs
=
configuration
.
packages
;
for
(
int
i
=
0
;
i
<
pkgs
.
length
;
i
++)
{
PackageUseWriter
.
generate
(
configuration
,
mapper
,
pkgs
[
i
]);
// If -nodeprecated option is set and the package is marked
// as deprecated, do not generate the package-use page.
if
(!(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
pkgs
[
i
])))
PackageUseWriter
.
generate
(
configuration
,
mapper
,
pkgs
[
i
]);
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
...
...
@@ -42,15 +42,15 @@ import com.sun.tools.doclets.formats.html.markup.*;
public
class
DeprecatedListWriter
extends
SubWriterHolderWriter
{
private
static
final
String
[]
ANCHORS
=
new
String
[]
{
"
interface"
,
"class"
,
"enum"
,
"exception"
,
"error"
,
"annotation_type
"
,
"field"
,
"method"
,
"constructor"
,
"enum_constant"
,
"
package"
,
"interface"
,
"class"
,
"enum"
,
"exception"
,
"error
"
,
"annotation_type"
,
"field"
,
"method"
,
"constructor"
,
"enum_constant"
,
"annotation_type_member"
};
private
static
final
String
[]
HEADING_KEYS
=
new
String
[]
{
"doclet.Deprecated_
Interfaces"
,
"doclet.Deprecated_Class
es"
,
"doclet.Deprecated_
Enums"
,
"doclet.Deprecated_Exception
s"
,
"doclet.Deprecated_Errors"
,
"doclet.Deprecated_
Packages"
,
"doclet.Deprecated_Interfac
es"
,
"doclet.Deprecated_
Classes"
,
"doclet.Deprecated_Enum
s"
,
"doclet.Deprecated_E
xceptions"
,
"doclet.Deprecated_E
rrors"
,
"doclet.Deprecated_Annotation_Types"
,
"doclet.Deprecated_Fields"
,
"doclet.Deprecated_Methods"
,
"doclet.Deprecated_Constructors"
,
...
...
@@ -59,9 +59,9 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
};
private
static
final
String
[]
SUMMARY_KEYS
=
new
String
[]
{
"doclet.deprecated_
interfaces"
,
"doclet.deprecated_class
es"
,
"doclet.deprecated_
enums"
,
"doclet.deprecated_exception
s"
,
"doclet.deprecated_errors"
,
"doclet.deprecated_
packages"
,
"doclet.deprecated_interfac
es"
,
"doclet.deprecated_
classes"
,
"doclet.deprecated_enum
s"
,
"doclet.deprecated_e
xceptions"
,
"doclet.deprecated_e
rrors"
,
"doclet.deprecated_annotation_types"
,
"doclet.deprecated_fields"
,
"doclet.deprecated_methods"
,
"doclet.deprecated_constructors"
,
...
...
@@ -70,7 +70,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
};
private
static
final
String
[]
HEADER_KEYS
=
new
String
[]
{
"doclet.Interface"
,
"doclet.Class"
,
"doclet.
Package"
,
"doclet.
Interface"
,
"doclet.Class"
,
"doclet.Enum"
,
"doclet.Exceptions"
,
"doclet.Errors"
,
"doclet.AnnotationType"
,
...
...
@@ -116,7 +116,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
DeprecatedListWriter
depr
=
new
DeprecatedListWriter
(
configuration
,
filename
);
depr
.
generateDeprecatedListFile
(
new
DeprecatedAPIListBuilder
(
configuration
.
root
));
new
DeprecatedAPIListBuilder
(
configuration
));
depr
.
close
();
}
catch
(
IOException
exc
)
{
configuration
.
standardmessage
.
error
(
...
...
@@ -149,8 +149,14 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
memberTableHeader
[
0
]
=
configuration
.
getText
(
"doclet.0_and_1"
,
configuration
.
getText
(
HEADER_KEYS
[
i
]),
configuration
.
getText
(
"doclet.Description"
));
writers
[
i
].
addDeprecatedAPI
(
deprapi
.
getList
(
i
),
HEADING_KEYS
[
i
],
memberTableSummary
,
memberTableHeader
,
div
);
// DeprecatedAPIListBuilder.PACKAGE == 0, so if i == 0, it is
// a PackageDoc.
if
(
i
==
DeprecatedAPIListBuilder
.
PACKAGE
)
addPackageDeprecatedAPI
(
deprapi
.
getList
(
i
),
HEADING_KEYS
[
i
],
memberTableSummary
,
memberTableHeader
,
div
);
else
writers
[
i
-
1
].
addDeprecatedAPI
(
deprapi
.
getList
(
i
),
HEADING_KEYS
[
i
],
memberTableSummary
,
memberTableHeader
,
div
);
}
}
body
.
addContent
(
div
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
...
...
@@ -198,23 +198,27 @@ public class HtmlDoclet extends AbstractDoclet {
PackageIndexFrameWriter
.
generate
(
configuration
);
}
PackageDoc
prev
=
null
,
next
;
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
PackageFrameWriter
.
generate
(
configuration
,
packages
[
i
]);
next
=
(
i
+
1
<
packages
.
length
&&
packages
[
i
+
1
].
name
().
length
()
>
0
)
?
packages
[
i
+
1
]
:
null
;
//If the next package is unnamed package, skip 2 ahead if possible
next
=
(
i
+
2
<
packages
.
length
&&
next
==
null
)
?
packages
[
i
+
2
]:
next
;
AbstractBuilder
packageSummaryBuilder
=
configuration
.
getBuilderFactory
().
getPackageSummaryBuilder
(
packages
[
i
],
prev
,
next
);
packageSummaryBuilder
.
build
();
if
(
configuration
.
createtree
)
{
PackageTreeWriter
.
generate
(
configuration
,
packages
[
i
],
prev
,
next
,
configuration
.
nodeprecated
);
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
// if -nodeprecated option is set and the package is marked as
// deprecated, do not generate the package-summary.html, package-frame.html
// and package-tree.html pages for that package.
if
(!(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
packages
[
i
])))
{
PackageFrameWriter
.
generate
(
configuration
,
packages
[
i
]);
next
=
(
i
+
1
<
packages
.
length
&&
packages
[
i
+
1
].
name
().
length
()
>
0
)
?
packages
[
i
+
1
]
:
null
;
//If the next package is unnamed package, skip 2 ahead if possible
next
=
(
i
+
2
<
packages
.
length
&&
next
==
null
)
?
packages
[
i
+
2
]
:
next
;
AbstractBuilder
packageSummaryBuilder
=
configuration
.
getBuilderFactory
().
getPackageSummaryBuilder
(
packages
[
i
],
prev
,
next
);
packageSummaryBuilder
.
build
();
if
(
configuration
.
createtree
)
{
PackageTreeWriter
.
generate
(
configuration
,
packages
[
i
],
prev
,
next
,
configuration
.
nodeprecated
);
}
prev
=
packages
[
i
];
}
prev
=
packages
[
i
];
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
浏览文件 @
452b7aea
...
...
@@ -1394,6 +1394,44 @@ public class HtmlDocletWriter extends HtmlDocWriter {
return
new
StringContent
(
packageName
);
}
/**
* Add package deprecation information to the documentation tree
*
* @param deprPkgs list of deprecated packages
* @param headingKey the caption for the deprecated package table
* @param tableSummary the summary for the deprecated package table
* @param tableHeader table headers for the deprecated package table
* @param contentTree the content tree to which the deprecated package table will be added
*/
protected
void
addPackageDeprecatedAPI
(
List
<
Doc
>
deprPkgs
,
String
headingKey
,
String
tableSummary
,
String
[]
tableHeader
,
Content
contentTree
)
{
if
(
deprPkgs
.
size
()
>
0
)
{
Content
table
=
HtmlTree
.
TABLE
(
0
,
3
,
0
,
tableSummary
,
getTableCaption
(
configuration
().
getText
(
headingKey
)));
table
.
addContent
(
getSummaryTableHeader
(
tableHeader
,
"col"
));
Content
tbody
=
new
HtmlTree
(
HtmlTag
.
TBODY
);
for
(
int
i
=
0
;
i
<
deprPkgs
.
size
();
i
++)
{
PackageDoc
pkg
=
(
PackageDoc
)
deprPkgs
.
get
(
i
);
HtmlTree
td
=
HtmlTree
.
TD
(
HtmlStyle
.
colOne
,
getPackageLink
(
pkg
,
getPackageName
(
pkg
)));
if
(
pkg
.
tags
(
"deprecated"
).
length
>
0
)
{
addInlineDeprecatedComment
(
pkg
,
pkg
.
tags
(
"deprecated"
)[
0
],
td
);
}
HtmlTree
tr
=
HtmlTree
.
TR
(
td
);
if
(
i
%
2
==
0
)
{
tr
.
addStyle
(
HtmlStyle
.
altColor
);
}
else
{
tr
.
addStyle
(
HtmlStyle
.
rowColor
);
}
tbody
.
addContent
(
tr
);
}
table
.
addContent
(
tbody
);
Content
li
=
HtmlTree
.
LI
(
HtmlStyle
.
blockList
,
table
);
Content
ul
=
HtmlTree
.
UL
(
HtmlStyle
.
blockList
,
li
);
contentTree
.
addContent
(
ul
);
}
}
/**
* Prine table header information about color, column span and the font.
*
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1998, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
...
...
@@ -93,7 +93,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
packgen
=
new
PackageFrameWriter
(
configuration
,
packageDoc
);
String
pkgName
=
Util
.
getPackageName
(
packageDoc
);
Content
body
=
packgen
.
getBody
(
false
,
packgen
.
getWindowTitle
(
pkgName
));
Content
pkgNameContent
=
new
StringContent
(
pkgName
);
Content
pkgNameContent
=
new
RawHtml
(
pkgName
);
Content
heading
=
HtmlTree
.
HEADING
(
HtmlConstants
.
TITLE_HEADING
,
HtmlStyle
.
bar
,
packgen
.
getTargetPackageLink
(
packageDoc
,
"classFrame"
,
pkgNameContent
));
body
.
addContent
(
heading
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1998, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
...
...
@@ -80,7 +80,10 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
HtmlTree
ul
=
new
HtmlTree
(
HtmlTag
.
UL
);
ul
.
addAttr
(
HtmlAttr
.
TITLE
,
packagesLabel
.
toString
());
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
if
(
packages
[
i
]
!=
null
)
{
// Do not list the package if -nodeprecated option is set and the
// package is marked as deprecated.
if
(
packages
[
i
]
!=
null
&&
(!(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
packages
[
i
]))))
{
ul
.
addContent
(
getPackage
(
packages
[
i
]));
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java
浏览文件 @
452b7aea
...
...
@@ -137,6 +137,8 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
protected
void
addPackagesList
(
PackageDoc
[]
packages
,
Content
tbody
)
{
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
if
(
packages
[
i
]
!=
null
&&
packages
[
i
].
name
().
length
()
>
0
)
{
if
(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
packages
[
i
]))
continue
;
Content
packageLinkContent
=
getPackageLink
(
packages
[
i
],
getPackageName
(
packages
[
i
]));
Content
tdPackage
=
HtmlTree
.
TD
(
HtmlStyle
.
colFirst
,
packageLinkContent
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java
浏览文件 @
452b7aea
...
...
@@ -242,11 +242,16 @@ public class PackageUseWriter extends SubWriterHolderWriter {
*/
protected
void
addPackageUse
(
PackageDoc
pkg
,
Content
contentTree
)
throws
IOException
{
Content
tdFirst
=
HtmlTree
.
TD
(
HtmlStyle
.
colFirst
,
getHyperLink
(
""
,
pkg
.
name
(),
new
StringContent
(
Util
.
getPackageName
(
pkg
))));
getHyperLink
(
""
,
Util
.
getPackageName
(
pkg
),
new
RawHtml
(
Util
.
getPackageName
(
pkg
))));
contentTree
.
addContent
(
tdFirst
);
HtmlTree
tdLast
=
new
HtmlTree
(
HtmlTag
.
TD
);
tdLast
.
addStyle
(
HtmlStyle
.
colLast
);
addSummaryComment
(
pkg
,
tdLast
);
if
(
pkg
!=
null
&&
pkg
.
name
().
length
()
!=
0
)
{
addSummaryComment
(
pkg
,
tdLast
);
}
else
{
tdLast
.
addContent
(
getSpace
());
}
contentTree
.
addContent
(
tdLast
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java
浏览文件 @
452b7aea
...
...
@@ -114,11 +114,12 @@ public class PackageWriterImpl extends HtmlDocletWriter
Content
packageHead
=
new
RawHtml
(
heading
);
tHeading
.
addContent
(
packageHead
);
div
.
addContent
(
tHeading
);
addDeprecationInfo
(
div
);
if
(
packageDoc
.
inlineTags
().
length
>
0
&&
!
configuration
.
nocomment
)
{
HtmlTree
subTitle
Div
=
new
HtmlTree
(
HtmlTag
.
DIV
);
subTitleDiv
.
addStyle
(
HtmlStyle
.
subTitle
);
addSummaryComment
(
packageDoc
,
subTitle
Div
);
div
.
addContent
(
subTitle
Div
);
HtmlTree
docSummary
Div
=
new
HtmlTree
(
HtmlTag
.
DIV
);
docSummaryDiv
.
addStyle
(
HtmlStyle
.
docSummary
);
addSummaryComment
(
packageDoc
,
docSummary
Div
);
div
.
addContent
(
docSummary
Div
);
Content
space
=
getSpace
();
Content
descLink
=
getHyperLink
(
""
,
"package_description"
,
descriptionLabel
,
""
,
""
);
...
...
@@ -138,6 +139,28 @@ public class PackageWriterImpl extends HtmlDocletWriter
return
div
;
}
/**
* Add the package deprecation information to the documentation tree.
*
* @param div the content tree to which the deprecation information will be added
*/
public
void
addDeprecationInfo
(
Content
div
)
{
Tag
[]
deprs
=
packageDoc
.
tags
(
"deprecated"
);
if
(
Util
.
isDeprecated
(
packageDoc
))
{
HtmlTree
deprDiv
=
new
HtmlTree
(
HtmlTag
.
DIV
);
deprDiv
.
addStyle
(
HtmlStyle
.
deprecatedContent
);
Content
deprPhrase
=
HtmlTree
.
SPAN
(
HtmlStyle
.
strong
,
deprecatedPhrase
);
deprDiv
.
addContent
(
deprPhrase
);
if
(
deprs
.
length
>
0
)
{
Tag
[]
commentTags
=
deprs
[
0
].
inlineTags
();
if
(
commentTags
.
length
>
0
)
{
addInlineDeprecatedComment
(
packageDoc
,
deprs
[
0
],
deprDiv
);
}
}
div
.
addContent
(
deprDiv
);
}
}
/**
* {@inheritDoc}
*/
...
...
src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java
浏览文件 @
452b7aea
...
...
@@ -82,12 +82,20 @@ public class SourceToHTMLConverter {
}
PackageDoc
[]
pds
=
rd
.
specifiedPackages
();
for
(
int
i
=
0
;
i
<
pds
.
length
;
i
++)
{
convertPackage
(
configuration
,
pds
[
i
],
outputdir
);
// If -nodeprecated option is set and the package is marked as deprecated,
// do not convert the package files to HTML.
if
(!(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
pds
[
i
])))
convertPackage
(
configuration
,
pds
[
i
],
outputdir
);
}
ClassDoc
[]
cds
=
rd
.
specifiedClasses
();
for
(
int
i
=
0
;
i
<
cds
.
length
;
i
++)
{
convertClass
(
configuration
,
cds
[
i
],
getPackageOutputDir
(
outputdir
,
cds
[
i
].
containingPackage
()));
// If -nodeprecated option is set and the class is marked as deprecated
// or the containing package is deprecated, do not convert the
// package files to HTML.
if
(!(
configuration
.
nodeprecated
&&
(
Util
.
isDeprecated
(
cds
[
i
])
||
Util
.
isDeprecated
(
cds
[
i
].
containingPackage
()))))
convertClass
(
configuration
,
cds
[
i
],
getPackageOutputDir
(
outputdir
,
cds
[
i
].
containingPackage
()));
}
}
...
...
@@ -106,7 +114,12 @@ public class SourceToHTMLConverter {
String
classOutputdir
=
getPackageOutputDir
(
outputdir
,
pd
);
ClassDoc
[]
cds
=
pd
.
allClasses
();
for
(
int
i
=
0
;
i
<
cds
.
length
;
i
++)
{
convertClass
(
configuration
,
cds
[
i
],
classOutputdir
);
// If -nodeprecated option is set and the class is marked as deprecated,
// do not convert the package files to HTML. We do not check for
// containing package deprecation since it is already check in
// the calling method above.
if
(!(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
cds
[
i
])))
convertClass
(
configuration
,
cds
[
i
],
classOutputdir
);
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
...
...
@@ -132,7 +132,11 @@ public class TreeWriter extends AbstractTreeWriter {
HtmlTree
ul
=
new
HtmlTree
(
HtmlTag
.
UL
);
ul
.
addStyle
(
HtmlStyle
.
horizontal
);
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
if
(
packages
[
i
].
name
().
length
()
==
0
)
{
// If the package name length is 0 or if -nodeprecated option
// is set and the package is marked as deprecated, do not include
// the page in the list of package hierarchies.
if
(
packages
[
i
].
name
().
length
()
==
0
||
(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
packages
[
i
])))
{
continue
;
}
String
link
=
pathString
(
packages
[
i
],
"package-tree.html"
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
浏览文件 @
452b7aea
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010,
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
...
...
@@ -46,6 +46,7 @@ public enum HtmlStyle {
contentContainer
,
description
,
details
,
docSummary
,
header
,
horizontal
,
footer
,
...
...
@@ -67,6 +68,7 @@ public enum HtmlStyle {
subNavList
,
subTitle
,
summary
,
deprecatedContent
,
tabEnd
,
title
,
topNav
;
...
...
src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties
浏览文件 @
452b7aea
...
...
@@ -68,6 +68,7 @@ doclet.see.class_or_package_not_accessible=Tag {0}: reference not accessible: {1
doclet.see.malformed_tag
=
Tag {0}: Malformed: {1}
doclet.Inherited_API_Summary
=
Inherited API Summary
doclet.Deprecated_API
=
Deprecated API
doclet.Deprecated_Packages
=
Deprecated Packages
doclet.Deprecated_Classes
=
Deprecated Classes
doclet.Deprecated_Enums
=
Deprecated Enums
doclet.Deprecated_Interfaces
=
Deprecated Interfaces
...
...
@@ -79,6 +80,7 @@ doclet.Deprecated_Constructors=Deprecated Constructors
doclet.Deprecated_Methods
=
Deprecated Methods
doclet.Deprecated_Enum_Constants
=
Deprecated Enum Constants
doclet.Deprecated_Annotation_Type_Members
=
Deprecated Annotation Type Elements
doclet.deprecated_packages
=
deprecated packages
doclet.deprecated_classes
=
deprecated classes
doclet.deprecated_enums
=
deprecated enums
doclet.deprecated_interfaces
=
deprecated interfaces
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1997, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
...
...
@@ -419,7 +419,7 @@ public abstract class Configuration {
docencoding
=
encoding
;
}
classDocCatalog
=
new
ClassDocCatalog
(
root
.
specifiedClasses
());
classDocCatalog
=
new
ClassDocCatalog
(
root
.
specifiedClasses
()
,
this
);
initTagletManager
(
customTagStrs
);
}
...
...
@@ -677,15 +677,18 @@ public abstract class Configuration {
}
/**
* Return true if the doc element is getting documented, depending upon
* -nodeprecated option and @deprecated tag used. Return true if
* -nodeprecated is not used or @deprecated tag is not used.
* Return true if the ClassDoc element is getting documented, depending upon
* -nodeprecated option and the deprecation information. Return true if
* -nodeprecated is not used. Return false if -nodeprecated is used and if
* either ClassDoc element is deprecated or the containing package is deprecated.
*
* @param cd the ClassDoc for which the page generation is checked
*/
public
boolean
isGeneratedDoc
(
Doc
doc
)
{
public
boolean
isGeneratedDoc
(
ClassDoc
cd
)
{
if
(!
nodeprecated
)
{
return
true
;
}
return
(
doc
.
tags
(
"deprecated"
)).
length
==
0
;
return
!(
Util
.
isDeprecated
(
cd
)
||
Util
.
isDeprecated
(
cd
.
containingPackage
()))
;
}
/**
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
浏览文件 @
452b7aea
...
...
@@ -159,6 +159,16 @@ Page header and footer styles
padding-top
:
10px
;
}
/*
Content styles
*/
.deprecatedContent
{
margin
:
0
;
padding
:
10px
0
;
}
.docSummary
{
padding-top
:
10px
;
}
/*
Page layout container styles
*/
.contentContainer
,
.sourceContainer
,
.classUseContainer
,
.serializedFormContainer
,
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/DeprecatedTaglet.java
浏览文件 @
452b7aea
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003,
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
...
...
@@ -44,13 +44,6 @@ public class DeprecatedTaglet extends BaseTaglet{
name
=
"deprecated"
;
}
/**
* {@inheritDoc}
*/
public
boolean
inPackage
()
{
return
false
;
}
/**
* {@inheritDoc}
*/
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java
浏览文件 @
452b7aea
/*
* Copyright (c) 2001, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
...
...
@@ -25,8 +25,9 @@
package
com.sun.tools.doclets.internal.toolkit.util
;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
com.sun.javadoc.*
;
import
com.sun.tools.doclets.internal.toolkit.Configuration
;
/**
* This class acts as an artificial PackageDoc for classes specified
...
...
@@ -88,13 +89,16 @@ import java.util.*;
*/
private
Map
<
String
,
Set
<
ClassDoc
>>
interfaces
;
private
Configuration
configuration
;
/**
* Construct a new ClassDocCatalog.
*
* @param classdocs the array of ClassDocs to catalog
*/
public
ClassDocCatalog
(
ClassDoc
[]
classdocs
)
{
public
ClassDocCatalog
(
ClassDoc
[]
classdocs
,
Configuration
config
)
{
init
();
this
.
configuration
=
config
;
for
(
int
i
=
0
;
i
<
classdocs
.
length
;
i
++)
{
addClassDoc
(
classdocs
[
i
]);
}
...
...
@@ -151,9 +155,10 @@ import java.util.*;
private
void
addClass
(
ClassDoc
classdoc
,
Map
<
String
,
Set
<
ClassDoc
>>
map
)
{
PackageDoc
pkg
=
classdoc
.
containingPackage
();
if
(
pkg
.
isIncluded
())
{
//No need to catalog this class since it's package is
//included on the command line
if
(
pkg
.
isIncluded
()
||
(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
pkg
)))
{
//No need to catalog this class if it's package is
//included on the command line or if -nodeprecated option is set
// and the containing package is marked as deprecated.
return
;
}
String
key
=
Util
.
getPackageName
(
pkg
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1998, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
...
...
@@ -122,8 +122,12 @@ public class ClassTree {
*/
private
void
buildTree
(
ClassDoc
[]
classes
,
Configuration
configuration
)
{
for
(
int
i
=
0
;
i
<
classes
.
length
;
i
++)
{
// In the tree page (e.g overview-tree.html) do not include
// information of classes which are deprecated or are a part of a
// deprecated package.
if
(
configuration
.
nodeprecated
&&
classes
[
i
].
tags
(
"deprecated"
).
length
>
0
)
{
(
Util
.
isDeprecated
(
classes
[
i
])
||
Util
.
isDeprecated
(
classes
[
i
].
containingPackage
())))
{
continue
;
}
if
(
classes
[
i
].
isEnum
())
{
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1998, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
...
...
@@ -27,27 +27,29 @@ package com.sun.tools.doclets.internal.toolkit.util;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
com.sun.tools.doclets.internal.toolkit.Configuration
;
/**
* Build list of all the deprecated classes, constructors, fields and methods.
* Build list of all the deprecated
packages,
classes, constructors, fields and methods.
*
* @author Atul M Dambalkar
*/
public
class
DeprecatedAPIListBuilder
{
public
static
final
int
NUM_TYPES
=
1
1
;
public
static
final
int
NUM_TYPES
=
1
2
;
public
static
final
int
INTERFACE
=
0
;
public
static
final
int
CLASS
=
1
;
public
static
final
int
ENUM
=
2
;
public
static
final
int
EXCEPTION
=
3
;
public
static
final
int
ERROR
=
4
;
public
static
final
int
ANNOTATION_TYPE
=
5
;
public
static
final
int
FIELD
=
6
;
public
static
final
int
METHOD
=
7
;
public
static
final
int
CONSTRUCTOR
=
8
;
public
static
final
int
ENUM_CONSTANT
=
9
;
public
static
final
int
ANNOTATION_TYPE_MEMBER
=
10
;
public
static
final
int
PACKAGE
=
0
;
public
static
final
int
INTERFACE
=
1
;
public
static
final
int
CLASS
=
2
;
public
static
final
int
ENUM
=
3
;
public
static
final
int
EXCEPTION
=
4
;
public
static
final
int
ERROR
=
5
;
public
static
final
int
ANNOTATION_TYPE
=
6
;
public
static
final
int
FIELD
=
7
;
public
static
final
int
METHOD
=
8
;
public
static
final
int
CONSTRUCTOR
=
9
;
public
static
final
int
ENUM_CONSTANT
=
10
;
public
static
final
int
ANNOTATION_TYPE_MEMBER
=
11
;
/**
* List of deprecated type Lists.
...
...
@@ -58,25 +60,33 @@ public class DeprecatedAPIListBuilder {
/**
* Constructor.
*
* @param
root Root of the tree.
* @param
configuration the current configuration of the doclet
*/
public
DeprecatedAPIListBuilder
(
RootDoc
root
)
{
public
DeprecatedAPIListBuilder
(
Configuration
configuration
)
{
deprecatedLists
=
new
ArrayList
<
List
<
Doc
>>();
for
(
int
i
=
0
;
i
<
NUM_TYPES
;
i
++)
{
deprecatedLists
.
add
(
i
,
new
ArrayList
<
Doc
>());
}
buildDeprecatedAPIInfo
(
root
);
buildDeprecatedAPIInfo
(
configuration
);
}
/**
* Build the sorted list of all the deprecated APIs in this run.
* Build separate lists for deprecated
classes, constructors, methods and
* fields.
* Build separate lists for deprecated
packages, classes, constructors,
*
methods and
fields.
*
* @param
root Root of the tree
.
* @param
configuration the current configuration of the doclet
.
*/
private
void
buildDeprecatedAPIInfo
(
RootDoc
root
)
{
ClassDoc
[]
classes
=
root
.
classes
();
private
void
buildDeprecatedAPIInfo
(
Configuration
configuration
)
{
PackageDoc
[]
packages
=
configuration
.
packages
;
PackageDoc
pkg
;
for
(
int
c
=
0
;
c
<
packages
.
length
;
c
++)
{
pkg
=
packages
[
c
];
if
(
Util
.
isDeprecated
(
pkg
))
{
getList
(
PACKAGE
).
add
(
pkg
);
}
}
ClassDoc
[]
classes
=
configuration
.
root
.
classes
();
for
(
int
i
=
0
;
i
<
classes
.
length
;
i
++)
{
ClassDoc
cd
=
classes
[
i
];
if
(
Util
.
isDeprecated
(
cd
))
{
...
...
@@ -90,7 +100,7 @@ public class DeprecatedAPIListBuilder {
getList
(
ENUM
).
add
(
cd
);
}
else
if
(
cd
.
isError
())
{
getList
(
ERROR
).
add
(
cd
);
}
else
if
(
cd
.
isAnnotationType
())
{
}
else
if
(
cd
.
isAnnotationType
())
{
getList
(
ANNOTATION_TYPE
).
add
(
cd
);
}
}
...
...
@@ -102,7 +112,7 @@ public class DeprecatedAPIListBuilder {
}
if
(
cd
.
isAnnotationType
())
{
composeDeprecatedList
(
getList
(
ANNOTATION_TYPE_MEMBER
),
((
AnnotationTypeDoc
)
cd
).
elements
());
((
AnnotationTypeDoc
)
cd
).
elements
());
}
}
sortDeprecatedLists
();
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1998, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
...
...
@@ -207,7 +207,17 @@ public class IndexBuilder {
* Should this doc element be added to the index map?
*/
protected
boolean
shouldAddToIndexMap
(
Doc
element
)
{
return
!(
noDeprecated
&&
element
.
tags
(
"deprecated"
).
length
>
0
);
if
(
element
instanceof
PackageDoc
)
// Do not add to index map if -nodeprecated option is set and the
// package is marked as deprecated.
return
!(
noDeprecated
&&
Util
.
isDeprecated
(
element
));
else
// Do not add to index map if -nodeprecated option is set and if the
// Doc is marked as deprecated or the containing package is marked as
// deprecated.
return
!(
noDeprecated
&&
(
Util
.
isDeprecated
(
element
)
||
Util
.
isDeprecated
(((
ProgramElementDoc
)
element
).
containingPackage
())));
}
/**
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java
浏览文件 @
452b7aea
/*
* Copyright (c) 1998, 20
03
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
...
...
@@ -76,13 +76,16 @@ public class PackageListWriter extends PrintWriter {
protected
void
generatePackageListFile
(
RootDoc
root
)
{
PackageDoc
[]
packages
=
configuration
.
packages
;
String
[]
names
=
new
String
[
packages
.
length
]
;
ArrayList
<
String
>
names
=
new
ArrayList
<
String
>()
;
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
names
[
i
]
=
packages
[
i
].
name
();
// if the -nodeprecated option is set and the package is marked as
// deprecated, do not include it in the packages list.
if
(!(
configuration
.
nodeprecated
&&
Util
.
isDeprecated
(
packages
[
i
])))
names
.
add
(
packages
[
i
].
name
());
}
Array
s
.
sort
(
names
);
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
println
(
names
[
i
]
);
Collection
s
.
sort
(
names
);
for
(
int
i
=
0
;
i
<
names
.
size
()
;
i
++)
{
println
(
names
.
get
(
i
)
);
}
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java
浏览文件 @
452b7aea
...
...
@@ -861,11 +861,15 @@ public class Util {
* @param doc the Doc to check.
* @return true if the given Doc is deprecated.
*/
public
static
boolean
isDeprecated
(
ProgramElement
Doc
doc
)
{
public
static
boolean
isDeprecated
(
Doc
doc
)
{
if
(
doc
.
tags
(
"deprecated"
).
length
>
0
)
{
return
true
;
}
AnnotationDesc
[]
annotationDescList
=
doc
.
annotations
();
AnnotationDesc
[]
annotationDescList
;
if
(
doc
instanceof
PackageDoc
)
annotationDescList
=
((
PackageDoc
)
doc
).
annotations
();
else
annotationDescList
=
((
ProgramElementDoc
)
doc
).
annotations
();
for
(
int
i
=
0
;
i
<
annotationDescList
.
length
;
i
++)
{
if
(
annotationDescList
[
i
].
annotationType
().
qualifiedName
().
equals
(
java
.
lang
.
Deprecated
.
class
.
getName
())){
...
...
test/com/sun/javadoc/testPackageDeprecation/C2.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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.
*/
/**
* Another test class.
*
* @author Bhavesh Patel
*/
public
class
C2
{
public
static
enum
ModalExclusionType
{
/**
* Test comment.
*/
NO_EXCLUDE
,
/**
* Another comment.
*/
APPLICATION_EXCLUDE
};
/**
* A string constant.
*/
public
static
final
String
CONSTANT1
=
"C2"
;
/**
* A sample method.
*
* @param param some parameter.
*/
public
void
method
(
String
param
)
{
}
}
test/com/sun/javadoc/testPackageDeprecation/FooDepr.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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.
*/
import
java.util.*
;
/**
* Test Deprecated class
* @deprecated This class is Deprecated.
*/
public
class
FooDepr
{
public
void
method
(
Vector
<
Object
>
o
){}
}
test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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.
*/
/*
* @test
* @bug 6492694
* @summary Test package deprecation.
* @author bpatel
* @library ../lib/
* @build JavadocTester TestPackageDeprecation
* @run main TestPackageDeprecation
*/
public
class
TestPackageDeprecation
extends
JavadocTester
{
//Test information.
private
static
final
String
BUG_ID
=
"6492694"
;
//Javadoc arguments.
private
static
final
String
[]
ARGS1
=
new
String
[]{
"-d"
,
BUG_ID
+
"-1"
,
"-source"
,
"1.5"
,
"-sourcepath"
,
SRC_DIR
,
"-use"
,
"pkg"
,
"pkg1"
,
SRC_DIR
+
FS
+
"C2.java"
,
SRC_DIR
+
FS
+
"FooDepr.java"
};
private
static
final
String
[]
ARGS2
=
new
String
[]{
"-d"
,
BUG_ID
+
"-2"
,
"-source"
,
"1.5"
,
"-sourcepath"
,
SRC_DIR
,
"-use"
,
"-nodeprecated"
,
"pkg"
,
"pkg1"
,
SRC_DIR
+
FS
+
"C2.java"
,
SRC_DIR
+
FS
+
"FooDepr.java"
};
//Input for string search tests.
private
static
final
String
[][]
TEST1
=
{
{
BUG_ID
+
"-1"
+
FS
+
"pkg1"
+
FS
+
"package-summary.html"
,
"<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>"
+
NL
+
"<div class=\"block\"><i>This package is Deprecated.</i></div>"
},
{
BUG_ID
+
"-1"
+
FS
+
"deprecated-list.html"
,
"<li><a href=\"#package\">Deprecated Packages</a></li>"
}
};
private
static
final
String
[][]
TEST2
=
NO_TEST
;
private
static
final
String
[][]
NEGATED_TEST1
=
NO_TEST
;
private
static
final
String
[][]
NEGATED_TEST2
=
{
{
BUG_ID
+
"-2"
+
FS
+
"overview-summary.html"
,
"pkg1"
},
{
BUG_ID
+
"-2"
+
FS
+
"allclasses-frame.html"
,
"FooDepr"
}
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public
static
void
main
(
String
[]
args
)
{
TestPackageDeprecation
tester
=
new
TestPackageDeprecation
();
run
(
tester
,
ARGS1
,
TEST1
,
NEGATED_TEST1
);
run
(
tester
,
ARGS2
,
TEST2
,
NEGATED_TEST2
);
if
((
new
java
.
io
.
File
(
BUG_ID
+
"-2"
+
FS
+
"pkg1"
+
FS
+
"package-summary.html"
)).
exists
())
{
throw
new
Error
(
"Test Fails: packages summary should not be"
+
"generated for deprecated package."
);
}
else
{
System
.
out
.
println
(
"Test passes: package-summary.html not found."
);
}
if
((
new
java
.
io
.
File
(
BUG_ID
+
"-2"
+
FS
+
"FooDepr.html"
)).
exists
())
{
throw
new
Error
(
"Test Fails: FooDepr should not be"
+
"generated as it is deprecated."
);
}
else
{
System
.
out
.
println
(
"Test passes: FooDepr.html not found."
);
}
tester
.
printSummary
();
}
/**
* {@inheritDoc}
*/
public
String
getBugId
()
{
return
BUG_ID
;
}
/**
* {@inheritDoc}
*/
public
String
getBugName
()
{
return
getClass
().
getName
();
}
}
test/com/sun/javadoc/testPackageDeprecation/pkg/A.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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
A
{
/** Test constant. */
public
static
final
String
DEMO
=
"y"
;
public
static
final
String
THIS_IS_OK
=
"(x)"
;
public
String
DEMO_STRING
=
"<Hello World>"
;
public
A
()
{
}
}
test/com/sun/javadoc/testPackageDeprecation/pkg1/ClassUseTest1.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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
pkg1
;
public
class
ClassUseTest1
<
T
extends
Foo
&
Foo2
>
{
public
<
T
extends
Foo
&
Foo2
>
T
method
(
T
t
)
{
return
null
;
}
}
test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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
pkg1
;
import
java.util.*
;
/**
* Test Deprecated class
* @deprecated This class is Deprecated.
*/
public
class
Foo
{
public
void
method
(
Vector
<
Object
>
o
){}
}
test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo2.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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
pkg1
;
public
interface
Foo2
{}
test/com/sun/javadoc/testPackageDeprecation/pkg1/package-info.java
0 → 100644
浏览文件 @
452b7aea
/*
* 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.
*/
/**
* Test pkg1 used.
* @deprecated This package is Deprecated.
*/
package
pkg1
;
test/com/sun/javadoc/testSubTitle/TestSubTitle.java
浏览文件 @
452b7aea
...
...
@@ -37,8 +37,7 @@ public class TestSubTitle extends JavadocTester {
private
static
final
String
BUG_ID
=
"7010342"
;
private
static
final
String
[][]
TEST
=
{
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"package-summary.html"
,
"<div class=\"subTitle\">"
+
NL
+
"<div class=\"block\">This is the "
+
"description of package pkg.</div>"
+
NL
+
"</div>"
"<div class=\"block\">This is the description of package pkg.</div>"
},
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"C.html"
,
"<div class=\"subTitle\">pkg</div>"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录