6492694: @deprecated tag doesn't work in package-info files
Reviewed-by: jjg
This commit is contained in:
parent
80d69a4f40
commit
746cdfda77
@ -149,10 +149,19 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
|||||||
ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
|
ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
|
||||||
ClassDoc[] classes = configuration.root.classes();
|
ClassDoc[] classes = configuration.root.classes();
|
||||||
for (int i = 0; i < classes.length; i++) {
|
for (int i = 0; i < classes.length; 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]);
|
ClassUseWriter.generate(configuration, mapper, classes[i]);
|
||||||
}
|
}
|
||||||
PackageDoc[] pkgs = configuration.packages;
|
PackageDoc[] pkgs = configuration.packages;
|
||||||
for (int i = 0; i < pkgs.length; i++) {
|
for (int i = 0; i < pkgs.length; 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]);
|
PackageUseWriter.generate(configuration, mapper, pkgs[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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 {
|
public class DeprecatedListWriter extends SubWriterHolderWriter {
|
||||||
|
|
||||||
private static final String[] ANCHORS = new String[] {
|
private static final String[] ANCHORS = new String[] {
|
||||||
"interface", "class", "enum", "exception", "error", "annotation_type",
|
"package", "interface", "class", "enum", "exception", "error",
|
||||||
"field", "method", "constructor", "enum_constant",
|
"annotation_type", "field", "method", "constructor", "enum_constant",
|
||||||
"annotation_type_member"
|
"annotation_type_member"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final String[] HEADING_KEYS = new String[] {
|
private static final String[] HEADING_KEYS = new String[] {
|
||||||
"doclet.Deprecated_Interfaces", "doclet.Deprecated_Classes",
|
"doclet.Deprecated_Packages", "doclet.Deprecated_Interfaces",
|
||||||
"doclet.Deprecated_Enums", "doclet.Deprecated_Exceptions",
|
"doclet.Deprecated_Classes", "doclet.Deprecated_Enums",
|
||||||
"doclet.Deprecated_Errors",
|
"doclet.Deprecated_Exceptions", "doclet.Deprecated_Errors",
|
||||||
"doclet.Deprecated_Annotation_Types",
|
"doclet.Deprecated_Annotation_Types",
|
||||||
"doclet.Deprecated_Fields",
|
"doclet.Deprecated_Fields",
|
||||||
"doclet.Deprecated_Methods", "doclet.Deprecated_Constructors",
|
"doclet.Deprecated_Methods", "doclet.Deprecated_Constructors",
|
||||||
@ -59,9 +59,9 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private static final String[] SUMMARY_KEYS = new String[] {
|
private static final String[] SUMMARY_KEYS = new String[] {
|
||||||
"doclet.deprecated_interfaces", "doclet.deprecated_classes",
|
"doclet.deprecated_packages", "doclet.deprecated_interfaces",
|
||||||
"doclet.deprecated_enums", "doclet.deprecated_exceptions",
|
"doclet.deprecated_classes", "doclet.deprecated_enums",
|
||||||
"doclet.deprecated_errors",
|
"doclet.deprecated_exceptions", "doclet.deprecated_errors",
|
||||||
"doclet.deprecated_annotation_types",
|
"doclet.deprecated_annotation_types",
|
||||||
"doclet.deprecated_fields",
|
"doclet.deprecated_fields",
|
||||||
"doclet.deprecated_methods", "doclet.deprecated_constructors",
|
"doclet.deprecated_methods", "doclet.deprecated_constructors",
|
||||||
@ -70,7 +70,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private static final String[] HEADER_KEYS = new String[] {
|
private static final String[] HEADER_KEYS = new String[] {
|
||||||
"doclet.Interface", "doclet.Class",
|
"doclet.Package", "doclet.Interface", "doclet.Class",
|
||||||
"doclet.Enum", "doclet.Exceptions",
|
"doclet.Enum", "doclet.Exceptions",
|
||||||
"doclet.Errors",
|
"doclet.Errors",
|
||||||
"doclet.AnnotationType",
|
"doclet.AnnotationType",
|
||||||
@ -116,7 +116,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
|||||||
DeprecatedListWriter depr =
|
DeprecatedListWriter depr =
|
||||||
new DeprecatedListWriter(configuration, filename);
|
new DeprecatedListWriter(configuration, filename);
|
||||||
depr.generateDeprecatedListFile(
|
depr.generateDeprecatedListFile(
|
||||||
new DeprecatedAPIListBuilder(configuration.root));
|
new DeprecatedAPIListBuilder(configuration));
|
||||||
depr.close();
|
depr.close();
|
||||||
} catch (IOException exc) {
|
} catch (IOException exc) {
|
||||||
configuration.standardmessage.error(
|
configuration.standardmessage.error(
|
||||||
@ -149,7 +149,13 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
|||||||
memberTableHeader[0] = configuration.getText("doclet.0_and_1",
|
memberTableHeader[0] = configuration.getText("doclet.0_and_1",
|
||||||
configuration.getText(HEADER_KEYS[i]),
|
configuration.getText(HEADER_KEYS[i]),
|
||||||
configuration.getText("doclet.Description"));
|
configuration.getText("doclet.Description"));
|
||||||
writers[i].addDeprecatedAPI(deprapi.getList(i),
|
// 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);
|
HEADING_KEYS[i], memberTableSummary, memberTableHeader, div);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -199,14 +199,17 @@ public class HtmlDoclet extends AbstractDoclet {
|
|||||||
}
|
}
|
||||||
PackageDoc prev = null, next;
|
PackageDoc prev = null, next;
|
||||||
for (int i = 0; i < packages.length; i++) {
|
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]);
|
PackageFrameWriter.generate(configuration, packages[i]);
|
||||||
next = (i + 1 < packages.length && packages[i+1].name().length() > 0) ?
|
next = (i + 1 < packages.length &&
|
||||||
packages[i+1] : null;
|
packages[i + 1].name().length() > 0) ? packages[i + 1] : null;
|
||||||
//If the next package is unnamed package, skip 2 ahead if possible
|
//If the next package is unnamed package, skip 2 ahead if possible
|
||||||
next = (i + 2 < packages.length && next == null) ?
|
next = (i + 2 < packages.length && next == null) ? packages[i + 2] : next;
|
||||||
packages[i+2]: next;
|
AbstractBuilder packageSummaryBuilder =
|
||||||
AbstractBuilder packageSummaryBuilder = configuration.
|
configuration.getBuilderFactory().getPackageSummaryBuilder(
|
||||||
getBuilderFactory().getPackageSummaryBuilder(
|
|
||||||
packages[i], prev, next);
|
packages[i], prev, next);
|
||||||
packageSummaryBuilder.build();
|
packageSummaryBuilder.build();
|
||||||
if (configuration.createtree) {
|
if (configuration.createtree) {
|
||||||
@ -217,6 +220,7 @@ public class HtmlDoclet extends AbstractDoclet {
|
|||||||
prev = packages[i];
|
prev = packages[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for doclet added options here.
|
* Check for doclet added options here.
|
||||||
|
@ -1394,6 +1394,44 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
|||||||
return new StringContent(packageName);
|
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.
|
* Prine table header information about color, column span and the font.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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);
|
packgen = new PackageFrameWriter(configuration, packageDoc);
|
||||||
String pkgName = Util.getPackageName(packageDoc);
|
String pkgName = Util.getPackageName(packageDoc);
|
||||||
Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
|
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,
|
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
|
||||||
packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent));
|
packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent));
|
||||||
body.addContent(heading);
|
body.addContent(heading);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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);
|
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||||
ul.addAttr(HtmlAttr.TITLE, packagesLabel.toString());
|
ul.addAttr(HtmlAttr.TITLE, packagesLabel.toString());
|
||||||
for(int i = 0; i < packages.length; i++) {
|
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]));
|
ul.addContent(getPackage(packages[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,8 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
|||||||
protected void addPackagesList(PackageDoc[] packages, Content tbody) {
|
protected void addPackagesList(PackageDoc[] packages, Content tbody) {
|
||||||
for (int i = 0; i < packages.length; i++) {
|
for (int i = 0; i < packages.length; i++) {
|
||||||
if (packages[i] != null && packages[i].name().length() > 0) {
|
if (packages[i] != null && packages[i].name().length() > 0) {
|
||||||
|
if (configuration.nodeprecated && Util.isDeprecated(packages[i]))
|
||||||
|
continue;
|
||||||
Content packageLinkContent = getPackageLink(packages[i],
|
Content packageLinkContent = getPackageLink(packages[i],
|
||||||
getPackageName(packages[i]));
|
getPackageName(packages[i]));
|
||||||
Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent);
|
Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent);
|
||||||
|
@ -242,11 +242,16 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
|||||||
*/
|
*/
|
||||||
protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
|
protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
|
||||||
Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
|
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);
|
contentTree.addContent(tdFirst);
|
||||||
HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
|
HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
|
||||||
tdLast.addStyle(HtmlStyle.colLast);
|
tdLast.addStyle(HtmlStyle.colLast);
|
||||||
|
if (pkg != null && pkg.name().length() != 0) {
|
||||||
addSummaryComment(pkg, tdLast);
|
addSummaryComment(pkg, tdLast);
|
||||||
|
} else {
|
||||||
|
tdLast.addContent(getSpace());
|
||||||
|
}
|
||||||
contentTree.addContent(tdLast);
|
contentTree.addContent(tdLast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,11 +114,12 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
|||||||
Content packageHead = new RawHtml(heading);
|
Content packageHead = new RawHtml(heading);
|
||||||
tHeading.addContent(packageHead);
|
tHeading.addContent(packageHead);
|
||||||
div.addContent(tHeading);
|
div.addContent(tHeading);
|
||||||
|
addDeprecationInfo(div);
|
||||||
if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) {
|
if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) {
|
||||||
HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
|
HtmlTree docSummaryDiv = new HtmlTree(HtmlTag.DIV);
|
||||||
subTitleDiv.addStyle(HtmlStyle.subTitle);
|
docSummaryDiv.addStyle(HtmlStyle.docSummary);
|
||||||
addSummaryComment(packageDoc, subTitleDiv);
|
addSummaryComment(packageDoc, docSummaryDiv);
|
||||||
div.addContent(subTitleDiv);
|
div.addContent(docSummaryDiv);
|
||||||
Content space = getSpace();
|
Content space = getSpace();
|
||||||
Content descLink = getHyperLink("", "package_description",
|
Content descLink = getHyperLink("", "package_description",
|
||||||
descriptionLabel, "", "");
|
descriptionLabel, "", "");
|
||||||
@ -138,6 +139,28 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
|||||||
return div;
|
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}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -82,10 +82,18 @@ public class SourceToHTMLConverter {
|
|||||||
}
|
}
|
||||||
PackageDoc[] pds = rd.specifiedPackages();
|
PackageDoc[] pds = rd.specifiedPackages();
|
||||||
for (int i = 0; i < pds.length; i++) {
|
for (int i = 0; i < pds.length; i++) {
|
||||||
|
// 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);
|
convertPackage(configuration, pds[i], outputdir);
|
||||||
}
|
}
|
||||||
ClassDoc[] cds = rd.specifiedClasses();
|
ClassDoc[] cds = rd.specifiedClasses();
|
||||||
for (int i = 0; i < cds.length; i++) {
|
for (int i = 0; i < cds.length; i++) {
|
||||||
|
// 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],
|
convertClass(configuration, cds[i],
|
||||||
getPackageOutputDir(outputdir, cds[i].containingPackage()));
|
getPackageOutputDir(outputdir, cds[i].containingPackage()));
|
||||||
}
|
}
|
||||||
@ -106,6 +114,11 @@ public class SourceToHTMLConverter {
|
|||||||
String classOutputdir = getPackageOutputDir(outputdir, pd);
|
String classOutputdir = getPackageOutputDir(outputdir, pd);
|
||||||
ClassDoc[] cds = pd.allClasses();
|
ClassDoc[] cds = pd.allClasses();
|
||||||
for (int i = 0; i < cds.length; i++) {
|
for (int i = 0; i < cds.length; i++) {
|
||||||
|
// 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);
|
convertClass(configuration, cds[i], classOutputdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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);
|
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||||
ul.addStyle(HtmlStyle.horizontal);
|
ul.addStyle(HtmlStyle.horizontal);
|
||||||
for (int i = 0; i < packages.length; i++) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
String link = pathString(packages[i], "package-tree.html");
|
String link = pathString(packages[i], "package-tree.html");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -46,6 +46,7 @@ public enum HtmlStyle {
|
|||||||
contentContainer,
|
contentContainer,
|
||||||
description,
|
description,
|
||||||
details,
|
details,
|
||||||
|
docSummary,
|
||||||
header,
|
header,
|
||||||
horizontal,
|
horizontal,
|
||||||
footer,
|
footer,
|
||||||
@ -67,6 +68,7 @@ public enum HtmlStyle {
|
|||||||
subNavList,
|
subNavList,
|
||||||
subTitle,
|
subTitle,
|
||||||
summary,
|
summary,
|
||||||
|
deprecatedContent,
|
||||||
tabEnd,
|
tabEnd,
|
||||||
title,
|
title,
|
||||||
topNav;
|
topNav;
|
||||||
|
@ -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.see.malformed_tag=Tag {0}: Malformed: {1}
|
||||||
doclet.Inherited_API_Summary=Inherited API Summary
|
doclet.Inherited_API_Summary=Inherited API Summary
|
||||||
doclet.Deprecated_API=Deprecated API
|
doclet.Deprecated_API=Deprecated API
|
||||||
|
doclet.Deprecated_Packages=Deprecated Packages
|
||||||
doclet.Deprecated_Classes=Deprecated Classes
|
doclet.Deprecated_Classes=Deprecated Classes
|
||||||
doclet.Deprecated_Enums=Deprecated Enums
|
doclet.Deprecated_Enums=Deprecated Enums
|
||||||
doclet.Deprecated_Interfaces=Deprecated Interfaces
|
doclet.Deprecated_Interfaces=Deprecated Interfaces
|
||||||
@ -79,6 +80,7 @@ doclet.Deprecated_Constructors=Deprecated Constructors
|
|||||||
doclet.Deprecated_Methods=Deprecated Methods
|
doclet.Deprecated_Methods=Deprecated Methods
|
||||||
doclet.Deprecated_Enum_Constants=Deprecated Enum Constants
|
doclet.Deprecated_Enum_Constants=Deprecated Enum Constants
|
||||||
doclet.Deprecated_Annotation_Type_Members=Deprecated Annotation Type Elements
|
doclet.Deprecated_Annotation_Type_Members=Deprecated Annotation Type Elements
|
||||||
|
doclet.deprecated_packages=deprecated packages
|
||||||
doclet.deprecated_classes=deprecated classes
|
doclet.deprecated_classes=deprecated classes
|
||||||
doclet.deprecated_enums=deprecated enums
|
doclet.deprecated_enums=deprecated enums
|
||||||
doclet.deprecated_interfaces=deprecated interfaces
|
doclet.deprecated_interfaces=deprecated interfaces
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -419,7 +419,7 @@ public abstract class Configuration {
|
|||||||
docencoding = encoding;
|
docencoding = encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
classDocCatalog = new ClassDocCatalog(root.specifiedClasses());
|
classDocCatalog = new ClassDocCatalog(root.specifiedClasses(), this);
|
||||||
initTagletManager(customTagStrs);
|
initTagletManager(customTagStrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -677,15 +677,18 @@ public abstract class Configuration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the doc element is getting documented, depending upon
|
* Return true if the ClassDoc element is getting documented, depending upon
|
||||||
* -nodeprecated option and @deprecated tag used. Return true if
|
* -nodeprecated option and the deprecation information. Return true if
|
||||||
* -nodeprecated is not used or @deprecated tag is not used.
|
* -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) {
|
if (!nodeprecated) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return (doc.tags("deprecated")).length == 0;
|
return !(Util.isDeprecated(cd) || Util.isDeprecated(cd.containingPackage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -159,6 +159,16 @@ Page header and footer styles
|
|||||||
padding-top:10px;
|
padding-top:10px;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Content styles
|
||||||
|
*/
|
||||||
|
.deprecatedContent {
|
||||||
|
margin:0;
|
||||||
|
padding:10px 0;
|
||||||
|
}
|
||||||
|
.docSummary {
|
||||||
|
padding-top:10px;
|
||||||
|
}
|
||||||
|
/*
|
||||||
Page layout container styles
|
Page layout container styles
|
||||||
*/
|
*/
|
||||||
.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer,
|
.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -44,13 +44,6 @@ public class DeprecatedTaglet extends BaseTaglet{
|
|||||||
name = "deprecated";
|
name = "deprecated";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
public boolean inPackage() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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;
|
package com.sun.tools.doclets.internal.toolkit.util;
|
||||||
|
|
||||||
import com.sun.javadoc.*;
|
|
||||||
import java.util.*;
|
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
|
* This class acts as an artificial PackageDoc for classes specified
|
||||||
@ -88,13 +89,16 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
private Map<String,Set<ClassDoc>> interfaces;
|
private Map<String,Set<ClassDoc>> interfaces;
|
||||||
|
|
||||||
|
private Configuration configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new ClassDocCatalog.
|
* Construct a new ClassDocCatalog.
|
||||||
*
|
*
|
||||||
* @param classdocs the array of ClassDocs to catalog
|
* @param classdocs the array of ClassDocs to catalog
|
||||||
*/
|
*/
|
||||||
public ClassDocCatalog (ClassDoc[] classdocs) {
|
public ClassDocCatalog (ClassDoc[] classdocs, Configuration config) {
|
||||||
init();
|
init();
|
||||||
|
this.configuration = config;
|
||||||
for (int i = 0; i < classdocs.length; i++) {
|
for (int i = 0; i < classdocs.length; i++) {
|
||||||
addClassDoc(classdocs[i]);
|
addClassDoc(classdocs[i]);
|
||||||
}
|
}
|
||||||
@ -151,9 +155,10 @@ import java.util.*;
|
|||||||
private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
|
private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
|
||||||
|
|
||||||
PackageDoc pkg = classdoc.containingPackage();
|
PackageDoc pkg = classdoc.containingPackage();
|
||||||
if (pkg.isIncluded()) {
|
if (pkg.isIncluded() || (configuration.nodeprecated && Util.isDeprecated(pkg))) {
|
||||||
//No need to catalog this class since it's package is
|
//No need to catalog this class if it's package is
|
||||||
//included on the command line
|
//included on the command line or if -nodeprecated option is set
|
||||||
|
// and the containing package is marked as deprecated.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String key = Util.getPackageName(pkg);
|
String key = Util.getPackageName(pkg);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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) {
|
private void buildTree(ClassDoc[] classes, Configuration configuration) {
|
||||||
for (int i = 0; i < classes.length; i++) {
|
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 &&
|
if (configuration.nodeprecated &&
|
||||||
classes[i].tags("deprecated").length > 0) {
|
(Util.isDeprecated(classes[i]) ||
|
||||||
|
Util.isDeprecated(classes[i].containingPackage()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (classes[i].isEnum()) {
|
if (classes[i].isEnum()) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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 com.sun.javadoc.*;
|
||||||
import java.util.*;
|
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
|
* @author Atul M Dambalkar
|
||||||
*/
|
*/
|
||||||
public class DeprecatedAPIListBuilder {
|
public class DeprecatedAPIListBuilder {
|
||||||
|
|
||||||
public static final int NUM_TYPES = 11;
|
public static final int NUM_TYPES = 12;
|
||||||
|
|
||||||
public static final int INTERFACE = 0;
|
public static final int PACKAGE = 0;
|
||||||
public static final int CLASS = 1;
|
public static final int INTERFACE = 1;
|
||||||
public static final int ENUM = 2;
|
public static final int CLASS = 2;
|
||||||
public static final int EXCEPTION = 3;
|
public static final int ENUM = 3;
|
||||||
public static final int ERROR = 4;
|
public static final int EXCEPTION = 4;
|
||||||
public static final int ANNOTATION_TYPE = 5;
|
public static final int ERROR = 5;
|
||||||
public static final int FIELD = 6;
|
public static final int ANNOTATION_TYPE = 6;
|
||||||
public static final int METHOD = 7;
|
public static final int FIELD = 7;
|
||||||
public static final int CONSTRUCTOR = 8;
|
public static final int METHOD = 8;
|
||||||
public static final int ENUM_CONSTANT = 9;
|
public static final int CONSTRUCTOR = 9;
|
||||||
public static final int ANNOTATION_TYPE_MEMBER = 10;
|
public static final int ENUM_CONSTANT = 10;
|
||||||
|
public static final int ANNOTATION_TYPE_MEMBER = 11;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of deprecated type Lists.
|
* List of deprecated type Lists.
|
||||||
@ -58,25 +60,33 @@ public class DeprecatedAPIListBuilder {
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* 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>>();
|
deprecatedLists = new ArrayList<List<Doc>>();
|
||||||
for (int i = 0; i < NUM_TYPES; i++) {
|
for (int i = 0; i < NUM_TYPES; i++) {
|
||||||
deprecatedLists.add(i, new ArrayList<Doc>());
|
deprecatedLists.add(i, new ArrayList<Doc>());
|
||||||
}
|
}
|
||||||
buildDeprecatedAPIInfo(root);
|
buildDeprecatedAPIInfo(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the sorted list of all the deprecated APIs in this run.
|
* Build the sorted list of all the deprecated APIs in this run.
|
||||||
* Build separate lists for deprecated classes, constructors, methods and
|
* Build separate lists for deprecated packages, classes, constructors,
|
||||||
* fields.
|
* methods and fields.
|
||||||
*
|
*
|
||||||
* @param root Root of the tree.
|
* @param configuration the current configuration of the doclet.
|
||||||
*/
|
*/
|
||||||
private void buildDeprecatedAPIInfo(RootDoc root) {
|
private void buildDeprecatedAPIInfo(Configuration configuration) {
|
||||||
ClassDoc[] classes = root.classes();
|
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++) {
|
for (int i = 0; i < classes.length; i++) {
|
||||||
ClassDoc cd = classes[i];
|
ClassDoc cd = classes[i];
|
||||||
if (Util.isDeprecated(cd)) {
|
if (Util.isDeprecated(cd)) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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?
|
* Should this doc element be added to the index map?
|
||||||
*/
|
*/
|
||||||
protected boolean shouldAddToIndexMap(Doc element) {
|
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())));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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) {
|
protected void generatePackageListFile(RootDoc root) {
|
||||||
PackageDoc[] packages = configuration.packages;
|
PackageDoc[] packages = configuration.packages;
|
||||||
String[] names = new String[packages.length];
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
for (int i = 0; i < packages.length; i++) {
|
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());
|
||||||
}
|
}
|
||||||
Arrays.sort(names);
|
Collections.sort(names);
|
||||||
for (int i = 0; i < packages.length; i++) {
|
for (int i = 0; i < names.size(); i++) {
|
||||||
println(names[i]);
|
println(names.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -861,11 +861,15 @@ public class Util {
|
|||||||
* @param doc the Doc to check.
|
* @param doc the Doc to check.
|
||||||
* @return true if the given Doc is deprecated.
|
* @return true if the given Doc is deprecated.
|
||||||
*/
|
*/
|
||||||
public static boolean isDeprecated(ProgramElementDoc doc) {
|
public static boolean isDeprecated(Doc doc) {
|
||||||
if (doc.tags("deprecated").length > 0) {
|
if (doc.tags("deprecated").length > 0) {
|
||||||
return true;
|
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++) {
|
for (int i = 0; i < annotationDescList.length; i++) {
|
||||||
if (annotationDescList[i].annotationType().qualifiedName().equals(
|
if (annotationDescList[i].annotationType().qualifiedName().equals(
|
||||||
java.lang.Deprecated.class.getName())){
|
java.lang.Deprecated.class.getName())){
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* 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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* 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){}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* 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();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* 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() {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* 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){}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* 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 {}
|
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
@ -37,8 +37,7 @@ public class TestSubTitle extends JavadocTester {
|
|||||||
private static final String BUG_ID = "7010342";
|
private static final String BUG_ID = "7010342";
|
||||||
private static final String[][] TEST = {
|
private static final String[][] TEST = {
|
||||||
{BUG_ID + FS + "pkg" + FS + "package-summary.html",
|
{BUG_ID + FS + "pkg" + FS + "package-summary.html",
|
||||||
"<div class=\"subTitle\">" + NL + "<div class=\"block\">This is the " +
|
"<div class=\"block\">This is the description of package pkg.</div>"
|
||||||
"description of package pkg.</div>" + NL + "</div>"
|
|
||||||
},
|
},
|
||||||
{BUG_ID + FS + "pkg" + FS + "C.html",
|
{BUG_ID + FS + "pkg" + FS + "C.html",
|
||||||
"<div class=\"subTitle\">pkg</div>"
|
"<div class=\"subTitle\">pkg</div>"
|
||||||
|
Loading…
Reference in New Issue
Block a user