Merge
This commit is contained in:
commit
0de31c2237
@ -72,7 +72,7 @@ public interface Tag {
|
||||
* <code>kind() == name()</code>;
|
||||
* the following table lists those cases where there is more
|
||||
* than one tag of a given kind:
|
||||
* <p>
|
||||
*
|
||||
* <table border="1" cellpadding="4" cellspacing="0" summary="related tags">
|
||||
* <tr><th>{@code kind() }</th> <th>{@code name() }</th></tr>
|
||||
* <tr><td>{@code @throws }</td> <td>{@code @throws }</td></tr>
|
||||
|
@ -101,10 +101,10 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
||||
Content tdSummary) {
|
||||
ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
|
||||
String name = emd.name();
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
writer.getDocLink(context, cd, (MemberDoc) emd,
|
||||
name, false));
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
Content code = HtmlTree.CODE(memberLink);
|
||||
addParameters(emd, false, code, name.length() - 1);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
|
||||
String name = (member instanceof ExecutableMemberDoc)?
|
||||
member.name() + ((ExecutableMemberDoc)member).flatSignature() :
|
||||
member.name();
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
getDocLink(LinkInfoImpl.Kind.INDEX, member, name));
|
||||
Content dt = HtmlTree.DT(span);
|
||||
dt.addContent(" - ");
|
||||
@ -198,7 +198,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
|
||||
*/
|
||||
protected void addComment(ProgramElementDoc element, Content contentTree) {
|
||||
Tag[] tags;
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
HtmlTree div = new HtmlTree(HtmlTag.DIV);
|
||||
div.addStyle(HtmlStyle.block);
|
||||
if (Util.isDeprecated(element)) {
|
||||
|
@ -480,7 +480,7 @@ public abstract class AbstractMemberWriter {
|
||||
if (cd != null && !(pgmdoc instanceof ConstructorDoc)
|
||||
&& !(pgmdoc instanceof ClassDoc)) {
|
||||
HtmlTree name = new HtmlTree(HtmlTag.SPAN);
|
||||
name.addStyle(HtmlStyle.strong);
|
||||
name.addStyle(HtmlStyle.typeNameLabel);
|
||||
name.addContent(cd.name() + ".");
|
||||
tdLast.addContent(name);
|
||||
}
|
||||
|
@ -237,9 +237,9 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
|
||||
*/
|
||||
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
|
||||
Content tdSummary) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
Content code = HtmlTree.CODE(memberLink);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
|
||||
|
@ -239,9 +239,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
|
||||
*/
|
||||
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
|
||||
Content tdSummary) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
Content code = HtmlTree.CODE(memberLink);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
addSrcLink(annotationType, annotationName, pre);
|
||||
pre.addContent(parameterLinks);
|
||||
} else {
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.strong, annotationName);
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.memberNameLabel, annotationName);
|
||||
span.addContent(parameterLinks);
|
||||
pre.addContent(span);
|
||||
}
|
||||
@ -262,8 +262,8 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
annotationInfoTree.addContent(hr);
|
||||
Tag[] deprs = annotationType.tags("deprecated");
|
||||
if (Util.isDeprecated(annotationType)) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
Content div = HtmlTree.DIV(HtmlStyle.block, strong);
|
||||
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
|
||||
if (deprs.length > 0) {
|
||||
Tag[] commentTags = deprs[0].inlineTags();
|
||||
if (commentTags.length > 0) {
|
||||
|
@ -254,7 +254,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
addSrcLink(classDoc, className, pre);
|
||||
pre.addContent(parameterLinks);
|
||||
} else {
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.strong, className);
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.typeNameLabel, className);
|
||||
span.addContent(parameterLinks);
|
||||
pre.addContent(span);
|
||||
}
|
||||
@ -547,8 +547,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
classInfoTree.addContent(hr);
|
||||
Tag[] deprs = classDoc.tags("deprecated");
|
||||
if (Util.isDeprecated(classDoc)) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
Content div = HtmlTree.DIV(HtmlStyle.block, strong);
|
||||
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
|
||||
if (deprs.length > 0) {
|
||||
Tag[] commentTags = deprs[0].inlineTags();
|
||||
if (commentTags.length > 0) {
|
||||
|
@ -284,7 +284,7 @@ public class ConfigurationImpl extends Configuration {
|
||||
setTopFile(root);
|
||||
|
||||
if (root instanceof RootDocImpl) {
|
||||
((RootDocImpl) root).initDocLint(doclintOpts);
|
||||
((RootDocImpl) root).initDocLint(doclintOpts, tagletManager.getCustomTagNames());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,9 +224,9 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
|
||||
*/
|
||||
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
|
||||
Content tdSummary) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
Content code = HtmlTree.CODE(memberLink);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
|
||||
|
@ -140,11 +140,11 @@ public class FieldWriterImpl extends AbstractMemberWriter
|
||||
holder.typeName() : holder.qualifiedTypeName(),
|
||||
false);
|
||||
Content codeLink = HtmlTree.CODE(link);
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
|
||||
Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()?
|
||||
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
|
||||
strong.addContent(writer.getSpace());
|
||||
strong.addContent(codeLink);
|
||||
fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
|
||||
descfrmLabel.addContent(writer.getSpace());
|
||||
descfrmLabel.addContent(codeLink);
|
||||
fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
|
||||
writer.addInlineComment(field, fieldDocTree);
|
||||
}
|
||||
}
|
||||
@ -258,9 +258,9 @@ public class FieldWriterImpl extends AbstractMemberWriter
|
||||
*/
|
||||
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
|
||||
Content tdSummary) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false));
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
Content code = HtmlTree.CODE(memberLink);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
liConst.addContent(constPara);
|
||||
ul.addContent(liConst);
|
||||
Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
|
||||
Content line30 = HtmlTree.SPAN(HtmlStyle.italic, getResource("doclet.Help_line_30"));
|
||||
Content line30 = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, getResource("doclet.Help_line_30"));
|
||||
divContent.addContent(line30);
|
||||
contentTree.addContent(divContent);
|
||||
}
|
||||
|
@ -391,8 +391,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
tbody.addContent(tr);
|
||||
}
|
||||
table.addContent(tbody);
|
||||
Content li = HtmlTree.LI(HtmlStyle.blockList, table);
|
||||
summaryContentTree.addContent(li);
|
||||
summaryContentTree.addContent(table);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1051,7 +1050,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
|
||||
public Content italicsClassName(ClassDoc cd, boolean qual) {
|
||||
Content name = new StringContent((qual)? cd.qualifiedName(): cd.name());
|
||||
return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.italic, name): name;
|
||||
return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.interfaceName, name): name;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1567,7 +1566,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
Content div;
|
||||
Content result = commentTagsToContent(null, doc, tags, first);
|
||||
if (depr) {
|
||||
Content italic = HtmlTree.SPAN(HtmlStyle.italic, result);
|
||||
Content italic = HtmlTree.SPAN(HtmlStyle.deprecationComment, result);
|
||||
div = HtmlTree.DIV(HtmlStyle.block, italic);
|
||||
htmltree.addContent(div);
|
||||
}
|
||||
|
@ -160,11 +160,11 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
holder.typeName() : holder.qualifiedTypeName(),
|
||||
false);
|
||||
Content codelLink = HtmlTree.CODE(link);
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.asClassDoc().isClass()?
|
||||
Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.asClassDoc().isClass()?
|
||||
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
|
||||
strong.addContent(writer.getSpace());
|
||||
strong.addContent(codelLink);
|
||||
methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
|
||||
descfrmLabel.addContent(writer.getSpace());
|
||||
descfrmLabel.addContent(codelLink);
|
||||
methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
|
||||
writer.addInlineComment(method, methodDocTree);
|
||||
}
|
||||
}
|
||||
@ -310,7 +310,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
label = writer.specifiedByLabel;
|
||||
context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
|
||||
}
|
||||
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, label));
|
||||
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, label));
|
||||
dl.addContent(dt);
|
||||
Content overriddenTypeLink =
|
||||
writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType));
|
||||
@ -365,7 +365,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
Content intfaclink = writer.getLink(new LinkInfoImpl(
|
||||
writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac));
|
||||
Content codeIntfacLink = HtmlTree.CODE(intfaclink);
|
||||
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, writer.specifiedByLabel));
|
||||
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, writer.specifiedByLabel));
|
||||
dl.addContent(dt);
|
||||
Content methlink = writer.getDocLink(
|
||||
LinkInfoImpl.Kind.MEMBER, implementedMeth,
|
||||
|
@ -166,9 +166,9 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
|
||||
*/
|
||||
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
|
||||
Content tdSummary) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member)));
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
Content code = HtmlTree.CODE(memberLink);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
|
||||
printedHeader = true;
|
||||
}
|
||||
Content arr_i_name = new StringContent(arr[i].name());
|
||||
if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
|
||||
if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name);
|
||||
Content link = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
|
||||
Content li = HtmlTree.LI(link);
|
||||
|
@ -155,7 +155,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
|
||||
* @param div the content tree to which the link will be added
|
||||
*/
|
||||
protected void addLinkToMainTree(Content div) {
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
|
||||
getResource("doclet.Package_Hierarchies"));
|
||||
div.addContent(span);
|
||||
HtmlTree ul = new HtmlTree (HtmlTag.UL);
|
||||
|
@ -141,7 +141,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||
if (Util.isDeprecated(packageDoc)) {
|
||||
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
|
||||
deprDiv.addStyle(HtmlStyle.deprecatedContent);
|
||||
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
deprDiv.addContent(deprPhrase);
|
||||
if (deprs.length > 0) {
|
||||
Tag[] commentTags = deprs[0].inlineTags();
|
||||
|
@ -174,7 +174,7 @@ public class ProfilePackageFrameWriter extends HtmlDocletWriter {
|
||||
printedHeader = true;
|
||||
}
|
||||
Content arr_i_name = new StringContent(arr[i].name());
|
||||
if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
|
||||
if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name);
|
||||
Content link = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
|
||||
Content li = HtmlTree.LI(link);
|
||||
|
@ -158,7 +158,7 @@ public class ProfilePackageWriterImpl extends HtmlDocletWriter
|
||||
if (Util.isDeprecated(packageDoc)) {
|
||||
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
|
||||
deprDiv.addStyle(HtmlStyle.deprecatedContent);
|
||||
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
deprDiv.addContent(deprPhrase);
|
||||
if (deprs.length > 0) {
|
||||
Tag[] commentTags = deprs[0].inlineTags();
|
||||
@ -175,8 +175,11 @@ public class ProfilePackageWriterImpl extends HtmlDocletWriter
|
||||
*/
|
||||
public void addClassesSummary(ClassDoc[] classes, String label,
|
||||
String tableSummary, String[] tableHeader, Content packageSummaryContentTree) {
|
||||
HtmlTree li = new HtmlTree(HtmlTag.LI);
|
||||
li.addStyle(HtmlStyle.blockList);
|
||||
addClassesSummary(classes, label, tableSummary, tableHeader,
|
||||
packageSummaryContentTree, profileValue);
|
||||
li, profileValue);
|
||||
packageSummaryContentTree.addContent(li);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -187,7 +187,7 @@ public class ProfileWriterImpl extends HtmlDocletWriter
|
||||
deprs = pkg.tags("deprecated");
|
||||
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
|
||||
deprDiv.addStyle(HtmlStyle.deprecatedContent);
|
||||
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
deprDiv.addContent(deprPhrase);
|
||||
if (deprs.length > 0) {
|
||||
Tag[] commentTags = deprs[0].inlineTags();
|
||||
|
@ -136,11 +136,11 @@ public class PropertyWriterImpl extends AbstractMemberWriter
|
||||
holder.typeName() : holder.qualifiedTypeName(),
|
||||
false);
|
||||
Content codeLink = HtmlTree.CODE(link);
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
|
||||
Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()?
|
||||
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
|
||||
strong.addContent(writer.getSpace());
|
||||
strong.addContent(codeLink);
|
||||
propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
|
||||
descfrmLabel.addContent(writer.getSpace());
|
||||
descfrmLabel.addContent(codeLink);
|
||||
propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
|
||||
writer.addInlineComment(property, propertyDocTree);
|
||||
}
|
||||
}
|
||||
@ -255,14 +255,14 @@ public class PropertyWriterImpl extends AbstractMemberWriter
|
||||
*/
|
||||
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
|
||||
Content tdSummary) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
|
||||
writer.getDocLink(context, cd,
|
||||
(MemberDoc) member,
|
||||
member.name().substring(0, member.name().lastIndexOf("Property")),
|
||||
false,
|
||||
true));
|
||||
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
Content code = HtmlTree.CODE(memberLink);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
|
||||
|
@ -175,8 +175,8 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
Tag[] deprs = member.tags("deprecated");
|
||||
Content div;
|
||||
if (Util.isDeprecated((ProgramElementDoc) member)) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
div = HtmlTree.DIV(HtmlStyle.block, strong);
|
||||
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
|
||||
div.addContent(getSpace());
|
||||
if (deprs.length > 0) {
|
||||
addInlineDeprecatedComment(member, deprs[0], div);
|
||||
@ -186,8 +186,8 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
} else {
|
||||
ClassDoc cd = ((ProgramElementDoc)member).containingClass();
|
||||
if (cd != null && Util.isDeprecated(cd)) {
|
||||
Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
|
||||
div = HtmlTree.DIV(HtmlStyle.block, strong);
|
||||
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
|
||||
div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
|
||||
div.addContent(getSpace());
|
||||
tdSummary.addContent(div);
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
Tag[] deprs = doc.tags("deprecated");
|
||||
if (doc instanceof ClassDoc) {
|
||||
if (Util.isDeprecated((ProgramElementDoc) doc)) {
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.strong,
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
|
||||
new StringContent(configuration.getText("doclet.Deprecated"))));
|
||||
result.addContent(RawHtml.nbsp);
|
||||
if (deprs.length > 0) {
|
||||
@ -112,18 +112,18 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
} else {
|
||||
MemberDoc member = (MemberDoc) doc;
|
||||
if (Util.isDeprecated((ProgramElementDoc) doc)) {
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.strong,
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
|
||||
new StringContent(configuration.getText("doclet.Deprecated"))));
|
||||
result.addContent(RawHtml.nbsp);
|
||||
if (deprs.length > 0) {
|
||||
Content body = commentTagsToOutput(null, doc,
|
||||
deprs[0].inlineTags(), false);
|
||||
if (!body.isEmpty())
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.italic, body));
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecationComment, body));
|
||||
}
|
||||
} else {
|
||||
if (Util.isDeprecated(member.containingClass())) {
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.strong,
|
||||
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
|
||||
new StringContent(configuration.getText("doclet.Deprecated"))));
|
||||
result.addContent(RawHtml.nbsp);
|
||||
}
|
||||
@ -151,7 +151,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Content getParamHeader(String header) {
|
||||
HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
|
||||
HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.paramLabel,
|
||||
new StringContent(header)));
|
||||
return result;
|
||||
}
|
||||
@ -186,7 +186,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
*/
|
||||
public Content returnTagOutput(Tag returnTag) {
|
||||
ContentBuilder result = new ContentBuilder();
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.returnLabel,
|
||||
new StringContent(configuration.getText("doclet.Returns")))));
|
||||
result.addContent(HtmlTree.DD(htmlWriter.commentTagsToContent(
|
||||
returnTag, null, returnTag.inlineTags(), false)));
|
||||
@ -231,7 +231,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
return body;
|
||||
|
||||
ContentBuilder result = new ContentBuilder();
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.seeLabel,
|
||||
new StringContent(configuration.getText("doclet.See_Also")))));
|
||||
result.addContent(HtmlTree.DD(body));
|
||||
return result;
|
||||
@ -250,7 +250,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
*/
|
||||
public Content simpleTagOutput(Tag[] simpleTags, String header) {
|
||||
ContentBuilder result = new ContentBuilder();
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, new RawHtml(header))));
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header))));
|
||||
ContentBuilder body = new ContentBuilder();
|
||||
for (int i = 0; i < simpleTags.length; i++) {
|
||||
if (i > 0) {
|
||||
@ -268,7 +268,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
*/
|
||||
public Content simpleTagOutput(Tag simpleTag, String header) {
|
||||
ContentBuilder result = new ContentBuilder();
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, new RawHtml(header))));
|
||||
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header))));
|
||||
Content body = htmlWriter.commentTagsToContent(
|
||||
simpleTag, null, simpleTag.inlineTags(), false);
|
||||
result.addContent(HtmlTree.DD(body));
|
||||
@ -279,7 +279,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Content getThrowsHeader() {
|
||||
HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong,
|
||||
HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.throwsLabel,
|
||||
new StringContent(configuration.getText("doclet.Throws"))));
|
||||
return result;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class TreeWriter extends AbstractTreeWriter {
|
||||
return;
|
||||
}
|
||||
if (!classesonly) {
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.strong,
|
||||
Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
|
||||
getResource("doclet.Package_Hierarchies"));
|
||||
contentTree.addContent(span);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
|
@ -236,7 +236,7 @@ public abstract class HtmlDocWriter extends HtmlWriter {
|
||||
String stylename, String title, String target) {
|
||||
Content body = label;
|
||||
if (strong) {
|
||||
body = HtmlTree.SPAN(HtmlStyle.strong, body);
|
||||
body = HtmlTree.SPAN(HtmlStyle.typeNameLink, body);
|
||||
}
|
||||
if (stylename != null && stylename.length() != 0) {
|
||||
HtmlTree t = new HtmlTree(HtmlTag.FONT, body);
|
||||
|
@ -52,37 +52,51 @@ public enum HtmlStyle {
|
||||
constantValuesContainer,
|
||||
contentContainer,
|
||||
deprecatedContent,
|
||||
deprecatedLabel,
|
||||
deprecatedSummary,
|
||||
deprecationComment,
|
||||
description,
|
||||
descfrmTypeLabel,
|
||||
details,
|
||||
docSummary,
|
||||
emphasizedPhrase,
|
||||
header,
|
||||
horizontal,
|
||||
footer,
|
||||
indexContainer,
|
||||
indexHeader,
|
||||
inheritance,
|
||||
italic,
|
||||
interfaceName,
|
||||
legalCopy,
|
||||
memberNameLabel,
|
||||
memberNameLink,
|
||||
memberSummary,
|
||||
nameValue,
|
||||
navBarCell1Rev,
|
||||
navList,
|
||||
overrideSpecifyLabel,
|
||||
overviewSummary,
|
||||
packageHierarchyLabel,
|
||||
paramLabel,
|
||||
returnLabel,
|
||||
rowColor,
|
||||
seeLabel,
|
||||
serializedFormContainer,
|
||||
simpleTagLabel,
|
||||
skipNav,
|
||||
sourceContainer,
|
||||
sourceLineNo,
|
||||
strong,
|
||||
subNav,
|
||||
subNavList,
|
||||
subTitle,
|
||||
summary,
|
||||
tabEnd,
|
||||
tableTab,
|
||||
throwsLabel,
|
||||
title,
|
||||
topNav,
|
||||
typeNameLabel,
|
||||
typeNameLink,
|
||||
typeSummary,
|
||||
useSummary;
|
||||
}
|
||||
|
@ -514,9 +514,11 @@ h1.hidden {
|
||||
display:block;
|
||||
margin:3px 0 0 0;
|
||||
}
|
||||
.strong {
|
||||
.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
|
||||
.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel,
|
||||
.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink {
|
||||
font-weight:bold;
|
||||
}
|
||||
.italic {
|
||||
.deprecationComment, .emphasizedPhrase, .interfaceName {
|
||||
font-style:italic;
|
||||
}
|
||||
|
@ -205,6 +205,10 @@ public class TagletManager {
|
||||
}
|
||||
}
|
||||
|
||||
public Set<String> getCustomTagNames() {
|
||||
return customTags.keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new <code>Taglet</code>. Print a message to indicate whether or not
|
||||
* the Taglet was registered properly.
|
||||
|
@ -71,6 +71,8 @@ import com.sun.source.doctree.SinceTree;
|
||||
import com.sun.source.doctree.StartElementTree;
|
||||
import com.sun.source.doctree.TextTree;
|
||||
import com.sun.source.doctree.ThrowsTree;
|
||||
import com.sun.source.doctree.UnknownBlockTagTree;
|
||||
import com.sun.source.doctree.UnknownInlineTagTree;
|
||||
import com.sun.source.doctree.ValueTree;
|
||||
import com.sun.source.doctree.VersionTree;
|
||||
import com.sun.source.util.DocTreePath;
|
||||
@ -841,6 +843,23 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visitUnknownBlockTag(UnknownBlockTagTree tree, Void ignore) {
|
||||
checkUnknownTag(tree, tree.getTagName());
|
||||
return super.visitUnknownBlockTag(tree, ignore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visitUnknownInlineTag(UnknownInlineTagTree tree, Void ignore) {
|
||||
checkUnknownTag(tree, tree.getTagName());
|
||||
return super.visitUnknownInlineTag(tree, ignore);
|
||||
}
|
||||
|
||||
private void checkUnknownTag(DocTree tree, String tagName) {
|
||||
if (env.customTags != null && !env.customTags.contains(tagName))
|
||||
env.messages.error(SYNTAX, tree, "dc.tag.unknown", tagName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visitValue(ValueTree tree, Void ignore) {
|
||||
ReferenceTree ref = tree.getReference();
|
||||
|
@ -78,6 +78,8 @@ public class DocLint implements Plugin {
|
||||
public static final String XMSGS_CUSTOM_PREFIX = "-Xmsgs:";
|
||||
private static final String STATS = "-stats";
|
||||
public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
|
||||
public static final String XCUSTOM_TAGS_PREFIX = "-XcustomTags:";
|
||||
public static final String TAGS_SEPARATOR = ",";
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Command-line entry point">
|
||||
public static void main(String... args) {
|
||||
@ -199,6 +201,8 @@ public class DocLint implements Plugin {
|
||||
env.messages.setOptions(null);
|
||||
} else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) {
|
||||
env.messages.setOptions(arg.substring(arg.indexOf(":") + 1));
|
||||
} else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
|
||||
env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
|
||||
} else if (arg.equals("-h") || arg.equals("-help") || arg.equals("--help")
|
||||
|| arg.equals("-?") || arg.equals("-usage")) {
|
||||
needHelp = true;
|
||||
@ -262,6 +266,8 @@ public class DocLint implements Plugin {
|
||||
} else if (arg.matches(XIMPLICIT_HEADERS + "[1-6]")) {
|
||||
char ch = arg.charAt(arg.length() - 1);
|
||||
env.setImplicitHeaders(Character.digit(ch, 10));
|
||||
} else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
|
||||
env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
|
||||
} else
|
||||
throw new IllegalArgumentException(arg);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ package com.sun.tools.doclint;
|
||||
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.LinkedHashSet;
|
||||
|
||||
import javax.lang.model.element.Element;
|
||||
import javax.lang.model.element.ElementKind;
|
||||
@ -86,6 +87,8 @@ public class Env {
|
||||
|
||||
int implicitHeaderLevel = 0;
|
||||
|
||||
Set<String> customTags;
|
||||
|
||||
// Utility classes
|
||||
DocTrees trees;
|
||||
Elements elements;
|
||||
@ -135,6 +138,14 @@ public class Env {
|
||||
implicitHeaderLevel = n;
|
||||
}
|
||||
|
||||
void setCustomTags(String cTags) {
|
||||
customTags = new LinkedHashSet<String>();
|
||||
for (String s : cTags.split(DocLint.TAGS_SEPARATOR)) {
|
||||
if (!s.isEmpty())
|
||||
customTags.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
/** Set the current declaration and its doc comment. */
|
||||
void setCurrent(TreePath path, DocCommentTree comment) {
|
||||
currPath = path;
|
||||
|
@ -25,6 +25,7 @@
|
||||
package com.sun.tools.javac.code;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@ -112,20 +113,17 @@ public abstract class AnnoConstruct implements AnnotatedConstruct {
|
||||
}
|
||||
|
||||
// Deal with inherited annotations
|
||||
if (direct == null && container == null)
|
||||
if (direct == null && container == null &&
|
||||
annoType.isAnnotationPresent(Inherited.class))
|
||||
return getInheritedAnnotations(annoType);
|
||||
|
||||
// Pack them in an array
|
||||
Attribute[] contained0 = null;
|
||||
if (container != null)
|
||||
contained0 = unpackAttributes(container);
|
||||
ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
|
||||
if (contained0 != null) {
|
||||
for (Attribute a : contained0)
|
||||
if (a instanceof Attribute.Compound)
|
||||
compounds = compounds.append((Attribute.Compound)a);
|
||||
}
|
||||
Attribute.Compound[] contained = compounds.toArray(new Attribute.Compound[compounds.size()]);
|
||||
Attribute.Compound[] contained = unpackContained(container);
|
||||
|
||||
// In case of an empty legacy container we might need to look for
|
||||
// inherited annos as well
|
||||
if (direct == null && contained.length == 0 &&
|
||||
annoType.isAnnotationPresent(Inherited.class))
|
||||
return getInheritedAnnotations(annoType);
|
||||
|
||||
int size = (direct == null ? 0 : 1) + contained.length;
|
||||
@SuppressWarnings("unchecked") // annoType is the Class for A
|
||||
@ -157,6 +155,19 @@ public abstract class AnnoConstruct implements AnnotatedConstruct {
|
||||
return arr;
|
||||
}
|
||||
|
||||
private Attribute.Compound[] unpackContained(Attribute.Compound container) {
|
||||
// Pack them in an array
|
||||
Attribute[] contained0 = null;
|
||||
if (container != null)
|
||||
contained0 = unpackAttributes(container);
|
||||
ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
|
||||
if (contained0 != null) {
|
||||
for (Attribute a : contained0)
|
||||
if (a instanceof Attribute.Compound)
|
||||
compounds = compounds.append((Attribute.Compound)a);
|
||||
}
|
||||
return compounds.toArray(new Attribute.Compound[compounds.size()]);
|
||||
}
|
||||
|
||||
// This method is part of the javax.lang.model API, do not use this in javac code.
|
||||
public <A extends Annotation> A getAnnotation(Class<A> annoType) {
|
||||
|
@ -270,6 +270,11 @@ public class Flags {
|
||||
*/
|
||||
public static final long POTENTIALLY_AMBIGUOUS = 1L<<48;
|
||||
|
||||
/**
|
||||
* Flag that marks a synthetic method body for a lambda expression
|
||||
*/
|
||||
public static final long LAMBDA_METHOD = 1L<<49;
|
||||
|
||||
/** Modifier masks.
|
||||
*/
|
||||
public static final int
|
||||
@ -378,7 +383,8 @@ public class Flags {
|
||||
NOT_IN_PROFILE(Flags.NOT_IN_PROFILE),
|
||||
BAD_OVERRIDE(Flags.BAD_OVERRIDE),
|
||||
SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
|
||||
THROWS(Flags.THROWS);
|
||||
THROWS(Flags.THROWS),
|
||||
LAMBDA_METHOD(Flags.LAMBDA_METHOD);
|
||||
|
||||
Flag(long flag) {
|
||||
this.value = flag;
|
||||
|
@ -100,7 +100,7 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||
/** The attributes of this symbol are contained in this
|
||||
* SymbolMetadata. The SymbolMetadata instance is NOT immutable.
|
||||
*/
|
||||
protected SymbolMetadata annotations;
|
||||
protected SymbolMetadata metadata;
|
||||
|
||||
|
||||
/** An accessor method for the attributes of this symbol.
|
||||
@ -108,9 +108,9 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||
* method to make sure that the class symbol is loaded.
|
||||
*/
|
||||
public List<Attribute.Compound> getRawAttributes() {
|
||||
return (annotations == null)
|
||||
return (metadata == null)
|
||||
? List.<Attribute.Compound>nil()
|
||||
: annotations.getDeclarationAttributes();
|
||||
: metadata.getDeclarationAttributes();
|
||||
}
|
||||
|
||||
/** An accessor method for the type attributes of this symbol.
|
||||
@ -118,9 +118,9 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||
* method to make sure that the class symbol is loaded.
|
||||
*/
|
||||
public List<Attribute.TypeCompound> getRawTypeAttributes() {
|
||||
return (annotations == null)
|
||||
return (metadata == null)
|
||||
? List.<Attribute.TypeCompound>nil()
|
||||
: annotations.getTypeAttributes();
|
||||
: metadata.getTypeAttributes();
|
||||
}
|
||||
|
||||
/** Fetch a particular annotation from a symbol. */
|
||||
@ -132,106 +132,106 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||
}
|
||||
|
||||
public boolean annotationsPendingCompletion() {
|
||||
return annotations == null ? false : annotations.pendingCompletion();
|
||||
return metadata == null ? false : metadata.pendingCompletion();
|
||||
}
|
||||
|
||||
public void appendAttributes(List<Attribute.Compound> l) {
|
||||
if (l.nonEmpty()) {
|
||||
initedAnnos().append(l);
|
||||
initedMetadata().append(l);
|
||||
}
|
||||
}
|
||||
|
||||
public void appendClassInitTypeAttributes(List<Attribute.TypeCompound> l) {
|
||||
if (l.nonEmpty()) {
|
||||
initedAnnos().appendClassInitTypeAttributes(l);
|
||||
initedMetadata().appendClassInitTypeAttributes(l);
|
||||
}
|
||||
}
|
||||
|
||||
public void appendInitTypeAttributes(List<Attribute.TypeCompound> l) {
|
||||
if (l.nonEmpty()) {
|
||||
initedAnnos().appendInitTypeAttributes(l);
|
||||
initedMetadata().appendInitTypeAttributes(l);
|
||||
}
|
||||
}
|
||||
|
||||
public void appendTypeAttributesWithCompletion(final Annotate.AnnotateRepeatedContext<Attribute.TypeCompound> ctx) {
|
||||
initedAnnos().appendTypeAttributesWithCompletion(ctx);
|
||||
initedMetadata().appendTypeAttributesWithCompletion(ctx);
|
||||
}
|
||||
|
||||
public void appendUniqueTypeAttributes(List<Attribute.TypeCompound> l) {
|
||||
if (l.nonEmpty()) {
|
||||
initedAnnos().appendUniqueTypes(l);
|
||||
initedMetadata().appendUniqueTypes(l);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Attribute.TypeCompound> getClassInitTypeAttributes() {
|
||||
return (annotations == null)
|
||||
return (metadata == null)
|
||||
? List.<Attribute.TypeCompound>nil()
|
||||
: annotations.getClassInitTypeAttributes();
|
||||
: metadata.getClassInitTypeAttributes();
|
||||
}
|
||||
|
||||
public List<Attribute.TypeCompound> getInitTypeAttributes() {
|
||||
return (annotations == null)
|
||||
return (metadata == null)
|
||||
? List.<Attribute.TypeCompound>nil()
|
||||
: annotations.getInitTypeAttributes();
|
||||
: metadata.getInitTypeAttributes();
|
||||
}
|
||||
|
||||
public List<Attribute.Compound> getDeclarationAttributes() {
|
||||
return (annotations == null)
|
||||
return (metadata == null)
|
||||
? List.<Attribute.Compound>nil()
|
||||
: annotations.getDeclarationAttributes();
|
||||
: metadata.getDeclarationAttributes();
|
||||
}
|
||||
|
||||
public boolean hasAnnotations() {
|
||||
return (annotations != null && !annotations.isEmpty());
|
||||
return (metadata != null && !metadata.isEmpty());
|
||||
}
|
||||
|
||||
public boolean hasTypeAnnotations() {
|
||||
return (annotations != null && !annotations.isTypesEmpty());
|
||||
return (metadata != null && !metadata.isTypesEmpty());
|
||||
}
|
||||
|
||||
public void prependAttributes(List<Attribute.Compound> l) {
|
||||
if (l.nonEmpty()) {
|
||||
initedAnnos().prepend(l);
|
||||
initedMetadata().prepend(l);
|
||||
}
|
||||
}
|
||||
|
||||
public void resetAnnotations() {
|
||||
initedAnnos().reset();
|
||||
initedMetadata().reset();
|
||||
}
|
||||
|
||||
public void setAttributes(Symbol other) {
|
||||
if (annotations != null || other.annotations != null) {
|
||||
initedAnnos().setAttributes(other.annotations);
|
||||
if (metadata != null || other.metadata != null) {
|
||||
initedMetadata().setAttributes(other.metadata);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDeclarationAttributes(List<Attribute.Compound> a) {
|
||||
if (annotations != null || a.nonEmpty()) {
|
||||
initedAnnos().setDeclarationAttributes(a);
|
||||
if (metadata != null || a.nonEmpty()) {
|
||||
initedMetadata().setDeclarationAttributes(a);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDeclarationAttributesWithCompletion(final Annotate.AnnotateRepeatedContext<Attribute.Compound> ctx) {
|
||||
initedAnnos().setDeclarationAttributesWithCompletion(ctx);
|
||||
initedMetadata().setDeclarationAttributesWithCompletion(ctx);
|
||||
}
|
||||
|
||||
public void setTypeAttributes(List<Attribute.TypeCompound> a) {
|
||||
if (annotations != null || a.nonEmpty()) {
|
||||
if (annotations == null)
|
||||
annotations = new SymbolMetadata(this);
|
||||
annotations.setTypeAttributes(a);
|
||||
if (metadata != null || a.nonEmpty()) {
|
||||
if (metadata == null)
|
||||
metadata = new SymbolMetadata(this);
|
||||
metadata.setTypeAttributes(a);
|
||||
}
|
||||
}
|
||||
|
||||
private SymbolMetadata initedAnnos() {
|
||||
if (annotations == null)
|
||||
annotations = new SymbolMetadata(this);
|
||||
return annotations;
|
||||
private SymbolMetadata initedMetadata() {
|
||||
if (metadata == null)
|
||||
metadata = new SymbolMetadata(this);
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/** This method is intended for debugging only. */
|
||||
public SymbolMetadata getAnnotations() {
|
||||
return annotations;
|
||||
public SymbolMetadata getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
@ -862,10 +862,10 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||
}
|
||||
|
||||
private void mergeAttributes() {
|
||||
if (annotations == null &&
|
||||
package_info.annotations != null) {
|
||||
annotations = new SymbolMetadata(this);
|
||||
annotations.setAttributes(package_info.annotations);
|
||||
if (metadata == null &&
|
||||
package_info.metadata != null) {
|
||||
metadata = new SymbolMetadata(this);
|
||||
metadata.setAttributes(package_info.metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -323,7 +323,16 @@ public class TypeAnnotations {
|
||||
if (type == null) {
|
||||
// When type is null, put the type annotations to the symbol.
|
||||
// This is used for constructor return annotations, for which
|
||||
// no appropriate type exists.
|
||||
// we use the type of the enclosing class.
|
||||
type = sym.getEnclosingElement().asType();
|
||||
|
||||
// Declaration annotations are always allowed on constructor returns.
|
||||
// Therefore, use typeAnnotations instead of onlyTypeAnnos.
|
||||
type = typeWithAnnotations(typetree, type, typeAnnotations, typeAnnotations);
|
||||
// Note that we don't use the result, the call to
|
||||
// typeWithAnnotations side-effects the type annotation positions.
|
||||
// This is important for constructors of nested classes.
|
||||
|
||||
sym.appendUniqueTypeAttributes(typeAnnotations);
|
||||
return;
|
||||
}
|
||||
@ -361,9 +370,9 @@ public class TypeAnnotations {
|
||||
sym.appendUniqueTypeAttributes(typeAnnotations);
|
||||
|
||||
if (sym.getKind() == ElementKind.PARAMETER ||
|
||||
sym.getKind() == ElementKind.LOCAL_VARIABLE ||
|
||||
sym.getKind() == ElementKind.RESOURCE_VARIABLE ||
|
||||
sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
|
||||
sym.getKind() == ElementKind.LOCAL_VARIABLE ||
|
||||
sym.getKind() == ElementKind.RESOURCE_VARIABLE ||
|
||||
sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
|
||||
// Make sure all type annotations from the symbol are also
|
||||
// on the owner.
|
||||
sym.owner.appendUniqueTypeAttributes(sym.getRawTypeAttributes());
|
||||
@ -404,11 +413,11 @@ public class TypeAnnotations {
|
||||
depth = depth.append(TypePathEntry.ARRAY);
|
||||
while (arType.elemtype.hasTag(TypeTag.ARRAY)) {
|
||||
if (arType.elemtype.isAnnotated()) {
|
||||
Type.AnnotatedType aelemtype = (Type.AnnotatedType) arType.elemtype;
|
||||
Type aelemtype = arType.elemtype;
|
||||
arType = (Type.ArrayType) aelemtype.unannotatedType();
|
||||
ArrayType prevToMod = tomodify;
|
||||
tomodify = new Type.ArrayType(null, arType.tsym);
|
||||
prevToMod.elemtype = (Type.AnnotatedType) tomodify.annotatedType(arType.elemtype.getAnnotationMirrors());
|
||||
prevToMod.elemtype = tomodify.annotatedType(arType.elemtype.getAnnotationMirrors());
|
||||
} else {
|
||||
arType = (Type.ArrayType) arType.elemtype;
|
||||
tomodify.elemtype = new Type.ArrayType(null, arType.tsym);
|
||||
@ -1212,6 +1221,22 @@ public class TypeAnnotations {
|
||||
super.visitTypeParameter(tree);
|
||||
}
|
||||
|
||||
private void copyNewClassAnnotationsToOwner(JCNewClass tree) {
|
||||
Symbol sym = tree.def.sym;
|
||||
TypeAnnotationPosition pos = new TypeAnnotationPosition();
|
||||
ListBuffer<Attribute.TypeCompound> newattrs =
|
||||
new ListBuffer<Attribute.TypeCompound>();
|
||||
|
||||
for (Attribute.TypeCompound old : sym.getRawTypeAttributes()) {
|
||||
newattrs.append(new Attribute.TypeCompound(old.type, old.values,
|
||||
pos));
|
||||
}
|
||||
|
||||
pos.type = TargetType.NEW;
|
||||
pos.pos = tree.pos;
|
||||
sym.owner.appendUniqueTypeAttributes(newattrs.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitNewClass(JCNewClass tree) {
|
||||
if (tree.def != null &&
|
||||
@ -1230,7 +1255,7 @@ public class TypeAnnotations {
|
||||
}
|
||||
Type before = classdecl.sym.type;
|
||||
separateAnnotationsKinds(classdecl, tree.clazz.type, classdecl.sym, pos);
|
||||
|
||||
copyNewClassAnnotationsToOwner(tree);
|
||||
// classdecl.sym.type now contains an annotated type, which
|
||||
// is not what we want there.
|
||||
// TODO: should we put this type somewhere in the superclass/interface?
|
||||
|
@ -250,6 +250,14 @@ public class Attr extends JCTree.Visitor {
|
||||
Type owntype = found;
|
||||
if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
|
||||
if (allowPoly && inferenceContext.free(found)) {
|
||||
if ((ownkind & ~resultInfo.pkind) == 0) {
|
||||
owntype = resultInfo.check(tree, inferenceContext.asFree(owntype));
|
||||
} else {
|
||||
log.error(tree.pos(), "unexpected.type",
|
||||
kindNames(resultInfo.pkind),
|
||||
kindName(ownkind));
|
||||
owntype = types.createErrorType(owntype);
|
||||
}
|
||||
inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt), new FreeTypeListener() {
|
||||
@Override
|
||||
public void typesInferred(InferenceContext inferenceContext) {
|
||||
@ -314,9 +322,6 @@ public class Attr extends JCTree.Visitor {
|
||||
case CLASSDEF:
|
||||
//class def is always an owner
|
||||
return ((JCClassDecl)env.tree).sym;
|
||||
case LAMBDA:
|
||||
//a lambda is an owner - return a fresh synthetic method symbol
|
||||
return new MethodSymbol(0, names.empty, null, syms.methodClass);
|
||||
case BLOCK:
|
||||
//static/instance init blocks are owner
|
||||
Symbol blockSym = env.info.scope.owner;
|
||||
@ -514,6 +519,15 @@ public class Attr extends JCTree.Visitor {
|
||||
protected ResultInfo dup(CheckContext newContext) {
|
||||
return new ResultInfo(pkind, pt, newContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (pt != null) {
|
||||
return pt.toString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class RecoveryInfo extends ResultInfo {
|
||||
@ -4065,8 +4079,6 @@ public class Attr extends JCTree.Visitor {
|
||||
* Apply the annotations to the particular type.
|
||||
*/
|
||||
public void annotateType(final JCTree tree, final List<JCAnnotation> annotations) {
|
||||
// Callers ensure this.
|
||||
// Assert.check(annotations != null && annotations.nonEmpty());
|
||||
annotate.typeAnnotation(new Annotate.Worker() {
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -4084,8 +4096,9 @@ public class Attr extends JCTree.Visitor {
|
||||
}
|
||||
|
||||
private static List<Attribute.TypeCompound> fromAnnotations(List<JCAnnotation> annotations) {
|
||||
if (annotations.isEmpty())
|
||||
if (annotations.isEmpty()) {
|
||||
return List.nil();
|
||||
}
|
||||
|
||||
ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
|
||||
for (JCAnnotation anno : annotations) {
|
||||
@ -4097,6 +4110,10 @@ public class Attr extends JCTree.Visitor {
|
||||
// Any better solutions?
|
||||
buf.append((Attribute.TypeCompound) anno.attribute);
|
||||
}
|
||||
// Eventually we will want to throw an exception here, but
|
||||
// we can't do that just yet, because it gets triggered
|
||||
// when attempting to attach an annotation that isn't
|
||||
// defined.
|
||||
}
|
||||
return buf.toList();
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ public class Check {
|
||||
inferenceContext.addFreeTypeListener(List.of(req), new FreeTypeListener() {
|
||||
@Override
|
||||
public void typesInferred(InferenceContext inferenceContext) {
|
||||
checkType(pos, found, inferenceContext.asInstType(req), checkContext);
|
||||
checkType(pos, inferenceContext.asInstType(found), inferenceContext.asInstType(req), checkContext);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -3011,7 +3011,6 @@ public class Check {
|
||||
boolean annotationApplicable(JCAnnotation a, Symbol s) {
|
||||
Attribute.Array arr = getAttributeTargetAttribute(a.annotationType.type.tsym);
|
||||
Name[] targets;
|
||||
|
||||
if (arr == null) {
|
||||
targets = defaultTargetMetaInfo(a, s);
|
||||
} else {
|
||||
@ -3028,7 +3027,7 @@ public class Check {
|
||||
}
|
||||
for (Name target : targets) {
|
||||
if (target == names.TYPE)
|
||||
{ if (s.kind == TYP) return true; }
|
||||
{ if (s.kind == TYP && !s.isAnonymous()) return true; }
|
||||
else if (target == names.FIELD)
|
||||
{ if (s.kind == VAR && s.owner.kind != MTH) return true; }
|
||||
else if (target == names.METHOD)
|
||||
|
@ -1718,9 +1718,9 @@ public class Flow {
|
||||
if (tree.body == null) {
|
||||
return;
|
||||
}
|
||||
/* MemberEnter can generate synthetic methods, ignore them
|
||||
/* Ignore synthetic methods, except for translated lambda methods.
|
||||
*/
|
||||
if ((tree.sym.flags() & SYNTHETIC) != 0) {
|
||||
if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1795,7 +1795,7 @@ public class Flow {
|
||||
protected void initParam(JCVariableDecl def) {
|
||||
inits.incl(def.sym.adr);
|
||||
uninits.excl(def.sym.adr);
|
||||
}
|
||||
}
|
||||
|
||||
public void visitVarDef(JCVariableDecl tree) {
|
||||
boolean track = trackable(tree.sym);
|
||||
|
@ -1768,9 +1768,11 @@ public class Infer {
|
||||
public Type apply(Type t) {
|
||||
if (t.hasTag(TYPEVAR)) {
|
||||
TypeVar tv = (TypeVar)t;
|
||||
return tv.isCaptured() ?
|
||||
new CapturedUndetVar((CapturedType)tv, types) :
|
||||
new UndetVar(tv, types);
|
||||
if (tv.isCaptured()) {
|
||||
return new CapturedUndetVar((CapturedType)tv, types);
|
||||
} else {
|
||||
return new UndetVar(tv, types);
|
||||
}
|
||||
} else {
|
||||
return t.map(this);
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ import com.sun.tools.javac.util.*;
|
||||
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
|
||||
import com.sun.source.tree.MemberReferenceTree.ReferenceMode;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@ -68,6 +69,7 @@ import static com.sun.tools.javac.tree.JCTree.Tag.*;
|
||||
*/
|
||||
public class LambdaToMethod extends TreeTranslator {
|
||||
|
||||
private Attr attr;
|
||||
private JCDiagnostic.Factory diags;
|
||||
private Log log;
|
||||
private Lower lower;
|
||||
@ -103,6 +105,35 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
/** Flag for alternate metafactories indicating the lambda object requires multiple bridges */
|
||||
public static final int FLAG_BRIDGES = 1 << 2;
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Instantiating">
|
||||
protected static final Context.Key<LambdaToMethod> unlambdaKey =
|
||||
new Context.Key<LambdaToMethod>();
|
||||
|
||||
public static LambdaToMethod instance(Context context) {
|
||||
LambdaToMethod instance = context.get(unlambdaKey);
|
||||
if (instance == null) {
|
||||
instance = new LambdaToMethod(context);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
private LambdaToMethod(Context context) {
|
||||
context.put(unlambdaKey, this);
|
||||
diags = JCDiagnostic.Factory.instance(context);
|
||||
log = Log.instance(context);
|
||||
lower = Lower.instance(context);
|
||||
names = Names.instance(context);
|
||||
syms = Symtab.instance(context);
|
||||
rs = Resolve.instance(context);
|
||||
make = TreeMaker.instance(context);
|
||||
types = Types.instance(context);
|
||||
transTypes = TransTypes.instance(context);
|
||||
analyzer = new LambdaAnalyzerPreprocessor();
|
||||
Options options = Options.instance(context);
|
||||
dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
|
||||
attr = Attr.instance(context);
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
private class KlassInfo {
|
||||
|
||||
/**
|
||||
@ -125,12 +156,15 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
*/
|
||||
private final VarSymbol deserParamSym;
|
||||
|
||||
private KlassInfo(Symbol kSym) {
|
||||
private final JCClassDecl clazz;
|
||||
|
||||
private KlassInfo(JCClassDecl clazz) {
|
||||
this.clazz = clazz;
|
||||
appendedMethodList = new ListBuffer<>();
|
||||
deserializeCases = new HashMap<String, ListBuffer<JCStatement>>();
|
||||
MethodType type = new MethodType(List.of(syms.serializedLambdaType), syms.objectType,
|
||||
List.<Type>nil(), syms.methodClass);
|
||||
deserMethodSym = makePrivateSyntheticMethod(STATIC, names.deserializeLambda, type, kSym);
|
||||
deserMethodSym = makePrivateSyntheticMethod(STATIC, names.deserializeLambda, type, clazz.sym);
|
||||
deserParamSym = new VarSymbol(FINAL, names.fromString("lambda"),
|
||||
syms.serializedLambdaType, deserMethodSym);
|
||||
}
|
||||
@ -140,37 +174,6 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
}
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Instantiating">
|
||||
private static final Context.Key<LambdaToMethod> unlambdaKey =
|
||||
new Context.Key<LambdaToMethod>();
|
||||
|
||||
public static LambdaToMethod instance(Context context) {
|
||||
LambdaToMethod instance = context.get(unlambdaKey);
|
||||
if (instance == null) {
|
||||
instance = new LambdaToMethod(context);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private Attr attr;
|
||||
|
||||
private LambdaToMethod(Context context) {
|
||||
diags = JCDiagnostic.Factory.instance(context);
|
||||
log = Log.instance(context);
|
||||
lower = Lower.instance(context);
|
||||
names = Names.instance(context);
|
||||
syms = Symtab.instance(context);
|
||||
rs = Resolve.instance(context);
|
||||
make = TreeMaker.instance(context);
|
||||
types = Types.instance(context);
|
||||
transTypes = TransTypes.instance(context);
|
||||
analyzer = new LambdaAnalyzerPreprocessor();
|
||||
Options options = Options.instance(context);
|
||||
dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
|
||||
attr = Attr.instance(context);
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="translate methods">
|
||||
@Override
|
||||
public <T extends JCTree> T translate(T tree) {
|
||||
@ -221,10 +224,16 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
KlassInfo prevKlassInfo = kInfo;
|
||||
try {
|
||||
kInfo = new KlassInfo(tree.sym);
|
||||
kInfo = new KlassInfo(tree);
|
||||
super.visitClassDef(tree);
|
||||
if (!kInfo.deserializeCases.isEmpty()) {
|
||||
kInfo.addMethod(makeDeserializeMethod(tree.sym));
|
||||
int prevPos = make.pos;
|
||||
try {
|
||||
make.at(tree);
|
||||
kInfo.addMethod(makeDeserializeMethod(tree.sym));
|
||||
} finally {
|
||||
make.at(prevPos);
|
||||
}
|
||||
}
|
||||
//add all translated instance methods here
|
||||
List<JCTree> newMethods = kInfo.appendedMethodList.toList();
|
||||
@ -400,26 +409,21 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
if (context == null || !analyzer.lambdaIdentSymbolFilter(tree.sym)) {
|
||||
super.visitIdent(tree);
|
||||
} else {
|
||||
LambdaTranslationContext lambdaContext = (LambdaTranslationContext) context;
|
||||
if (lambdaContext.getSymbolMap(PARAM).containsKey(tree.sym)) {
|
||||
Symbol translatedSym = lambdaContext.getSymbolMap(PARAM).get(tree.sym);
|
||||
result = make.Ident(translatedSym).setType(tree.type);
|
||||
translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
|
||||
} else if (lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) {
|
||||
Symbol translatedSym = lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym);
|
||||
result = make.Ident(translatedSym).setType(tree.type);
|
||||
translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
|
||||
} else if (lambdaContext.getSymbolMap(TYPE_VAR).containsKey(tree.sym)) {
|
||||
Symbol translatedSym = lambdaContext.getSymbolMap(TYPE_VAR).get(tree.sym);
|
||||
result = make.Ident(translatedSym).setType(translatedSym.type);
|
||||
translatedSym.setTypeAttributes(tree.sym.getRawTypeAttributes());
|
||||
} else if (lambdaContext.getSymbolMap(CAPTURED_VAR).containsKey(tree.sym)) {
|
||||
Symbol translatedSym = lambdaContext.getSymbolMap(CAPTURED_VAR).get(tree.sym);
|
||||
result = make.Ident(translatedSym).setType(tree.type);
|
||||
} else {
|
||||
//access to untranslated symbols (i.e. compile-time constants,
|
||||
//members defined inside the lambda body, etc.) )
|
||||
super.visitIdent(tree);
|
||||
int prevPos = make.pos;
|
||||
try {
|
||||
make.at(tree);
|
||||
|
||||
LambdaTranslationContext lambdaContext = (LambdaTranslationContext) context;
|
||||
JCTree ltree = lambdaContext.translate(tree);
|
||||
if (ltree != null) {
|
||||
result = ltree;
|
||||
} else {
|
||||
//access to untranslated symbols (i.e. compile-time constants,
|
||||
//members defined inside the lambda body, etc.) )
|
||||
super.visitIdent(tree);
|
||||
}
|
||||
} finally {
|
||||
make.at(prevPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -429,11 +433,21 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
LambdaTranslationContext lambdaContext = (LambdaTranslationContext)context;
|
||||
if (context != null && lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) {
|
||||
JCExpression init = translate(tree.init);
|
||||
result = make.VarDef((VarSymbol)lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym), init);
|
||||
int prevPos = make.pos;
|
||||
try {
|
||||
result = make.at(tree).VarDef((VarSymbol)lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym), init);
|
||||
} finally {
|
||||
make.at(prevPos);
|
||||
}
|
||||
} else if (context != null && lambdaContext.getSymbolMap(TYPE_VAR).containsKey(tree.sym)) {
|
||||
JCExpression init = translate(tree.init);
|
||||
VarSymbol xsym = (VarSymbol)lambdaContext.getSymbolMap(TYPE_VAR).get(tree.sym);
|
||||
result = make.VarDef(xsym, init);
|
||||
int prevPos = make.pos;
|
||||
try {
|
||||
result = make.at(tree).VarDef(xsym, init);
|
||||
} finally {
|
||||
make.at(prevPos);
|
||||
}
|
||||
// Replace the entered symbol for this variable
|
||||
Scope sc = tree.sym.owner.members();
|
||||
if (sc != null) {
|
||||
@ -460,23 +474,28 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
boolean isLambda_void = expr.type.hasTag(VOID);
|
||||
boolean isTarget_void = restype.hasTag(VOID);
|
||||
boolean isTarget_Void = types.isSameType(restype, types.boxedClass(syms.voidType).type);
|
||||
if (isTarget_void) {
|
||||
//target is void:
|
||||
// BODY;
|
||||
JCStatement stat = make.Exec(expr);
|
||||
return make.Block(0, List.<JCStatement>of(stat));
|
||||
} else if (isLambda_void && isTarget_Void) {
|
||||
//void to Void conversion:
|
||||
// BODY; return null;
|
||||
ListBuffer<JCStatement> stats = new ListBuffer<>();
|
||||
stats.append(make.Exec(expr));
|
||||
stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
|
||||
return make.Block(0, stats.toList());
|
||||
} else {
|
||||
//non-void to non-void conversion:
|
||||
// return (TYPE)BODY;
|
||||
JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype);
|
||||
return make.at(retExpr).Block(0, List.<JCStatement>of(make.Return(retExpr)));
|
||||
int prevPos = make.pos;
|
||||
try {
|
||||
if (isTarget_void) {
|
||||
//target is void:
|
||||
// BODY;
|
||||
JCStatement stat = make.at(expr).Exec(expr);
|
||||
return make.Block(0, List.<JCStatement>of(stat));
|
||||
} else if (isLambda_void && isTarget_Void) {
|
||||
//void to Void conversion:
|
||||
// BODY; return null;
|
||||
ListBuffer<JCStatement> stats = new ListBuffer<>();
|
||||
stats.append(make.at(expr).Exec(expr));
|
||||
stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
|
||||
return make.Block(0, stats.toList());
|
||||
} else {
|
||||
//non-void to non-void conversion:
|
||||
// return (TYPE)BODY;
|
||||
JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype);
|
||||
return make.at(retExpr).Block(0, List.<JCStatement>of(make.Return(retExpr)));
|
||||
}
|
||||
} finally {
|
||||
make.at(prevPos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -587,10 +606,10 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
DiagnosticPosition pos, List<Object> staticArgs, MethodType indyType) {
|
||||
String functionalInterfaceClass = classSig(targetType);
|
||||
String functionalInterfaceMethodName = samSym.getSimpleName().toString();
|
||||
String functionalInterfaceMethodSignature = methodSig(types.erasure(samSym.type));
|
||||
String functionalInterfaceMethodSignature = typeSig(types.erasure(samSym.type));
|
||||
String implClass = classSig(types.erasure(refSym.owner.type));
|
||||
String implMethodName = refSym.getQualifiedName().toString();
|
||||
String implMethodSignature = methodSig(types.erasure(refSym.type));
|
||||
String implMethodSignature = typeSig(types.erasure(refSym.type));
|
||||
|
||||
JCExpression kindTest = eqTest(syms.intType, deserGetter("getImplMethodKind", syms.intType), make.Literal(implMethodKind));
|
||||
ListBuffer<JCExpression> serArgs = new ListBuffer<>();
|
||||
@ -978,8 +997,14 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
}
|
||||
if (context.isSerializable()) {
|
||||
addDeserializationCase(refKind, refSym, tree.type, samSym,
|
||||
tree, staticArgs, indyType);
|
||||
int prevPos = make.pos;
|
||||
try {
|
||||
make.at(kInfo.clazz);
|
||||
addDeserializationCase(refKind, refSym, tree.type, samSym,
|
||||
tree, staticArgs, indyType);
|
||||
} finally {
|
||||
make.at(prevPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1098,8 +1123,21 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
* keep the count of lambda expression defined in given context (used to
|
||||
* generate unambiguous names for serializable lambdas)
|
||||
*/
|
||||
private Map<String, Integer> serializableLambdaCounts =
|
||||
new HashMap<String, Integer>();
|
||||
private class SyntheticMethodNameCounter {
|
||||
private Map<String, Integer> map = new HashMap<>();
|
||||
int getIndex(StringBuilder buf) {
|
||||
String temp = buf.toString();
|
||||
Integer count = map.get(temp);
|
||||
if (count == null) {
|
||||
count = 0;
|
||||
}
|
||||
++count;
|
||||
map.put(temp, count);
|
||||
return count;
|
||||
}
|
||||
}
|
||||
private SyntheticMethodNameCounter syntheticMethodNameCounts =
|
||||
new SyntheticMethodNameCounter();
|
||||
|
||||
private Map<Symbol, JCClassDecl> localClassDefs;
|
||||
|
||||
@ -1133,13 +1171,13 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
@Override
|
||||
public void visitClassDef(JCClassDecl tree) {
|
||||
List<Frame> prevStack = frameStack;
|
||||
Map<String, Integer> prevSerializableLambdaCount =
|
||||
serializableLambdaCounts;
|
||||
SyntheticMethodNameCounter prevSyntheticMethodNameCounts =
|
||||
syntheticMethodNameCounts;
|
||||
Map<ClassSymbol, Symbol> prevClinits = clinits;
|
||||
DiagnosticSource prevSource = log.currentSource();
|
||||
try {
|
||||
log.useSource(tree.sym.sourcefile);
|
||||
serializableLambdaCounts = new HashMap<String, Integer>();
|
||||
syntheticMethodNameCounts = new SyntheticMethodNameCounter();
|
||||
prevClinits = new HashMap<ClassSymbol, Symbol>();
|
||||
if (tree.sym.owner.kind == MTH) {
|
||||
localClassDefs.put(tree.sym, tree);
|
||||
@ -1165,7 +1203,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
finally {
|
||||
log.useSource(prevSource.getFile());
|
||||
frameStack = prevStack;
|
||||
serializableLambdaCounts = prevSerializableLambdaCount;
|
||||
syntheticMethodNameCounts = prevSyntheticMethodNameCounts;
|
||||
clinits = prevClinits;
|
||||
}
|
||||
}
|
||||
@ -1315,7 +1353,9 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
ListBuffer<JCVariableDecl> paramBuff = new ListBuffer<JCVariableDecl>();
|
||||
int i = 0;
|
||||
for (List<Type> l = ptypes; l.nonEmpty(); l = l.tail) {
|
||||
paramBuff.append(make.Param(make.paramName(i++), l.head, owner));
|
||||
JCVariableDecl param = make.Param(make.paramName(i++), l.head, owner);
|
||||
param.sym.pos = tree.pos;
|
||||
paramBuff.append(param);
|
||||
}
|
||||
List<JCVariableDecl> params = paramBuff.toList();
|
||||
|
||||
@ -1388,50 +1428,6 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
}
|
||||
|
||||
private Name lambdaName() {
|
||||
return names.lambda.append(names.fromString("" + lambdaCount++));
|
||||
}
|
||||
|
||||
/**
|
||||
* For a serializable lambda, generate a name which maximizes name
|
||||
* stability across deserialization.
|
||||
* @param owner
|
||||
* @return Name to use for the synthetic lambda method name
|
||||
*/
|
||||
private Name serializedLambdaName(Symbol owner) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append(names.lambda);
|
||||
// Append the name of the method enclosing the lambda.
|
||||
String methodName = owner.name.toString();
|
||||
if (methodName.equals("<clinit>"))
|
||||
methodName = "static";
|
||||
else if (methodName.equals("<init>"))
|
||||
methodName = "new";
|
||||
buf.append(methodName);
|
||||
buf.append('$');
|
||||
// Append a hash of the enclosing method signature to differentiate
|
||||
// overloaded enclosing methods. For lambdas enclosed in lambdas,
|
||||
// the generated lambda method will not have type yet, but the
|
||||
// enclosing method's name will have been generated with this same
|
||||
// method, so it will be unique and never be overloaded.
|
||||
Assert.check(owner.type != null || directlyEnclosingLambda() != null);
|
||||
if (owner.type != null) {
|
||||
int methTypeHash = methodSig(owner.type).hashCode();
|
||||
buf.append(Integer.toHexString(methTypeHash));
|
||||
}
|
||||
buf.append('$');
|
||||
// The above appended name components may not be unique, append a
|
||||
// count based on the above name components.
|
||||
String temp = buf.toString();
|
||||
Integer count = serializableLambdaCounts.get(temp);
|
||||
if (count == null) {
|
||||
count = 0;
|
||||
}
|
||||
buf.append(count++);
|
||||
serializableLambdaCounts.put(temp, count);
|
||||
return names.fromString(buf.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a valid owner given the current declaration stack
|
||||
* (required to skip synthetic lambda symbols)
|
||||
@ -1648,19 +1644,19 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
private abstract class TranslationContext<T extends JCFunctionalExpression> {
|
||||
|
||||
/** the underlying (untranslated) tree */
|
||||
T tree;
|
||||
final T tree;
|
||||
|
||||
/** points to the adjusted enclosing scope in which this lambda/mref expression occurs */
|
||||
Symbol owner;
|
||||
final Symbol owner;
|
||||
|
||||
/** the depth of this lambda expression in the frame stack */
|
||||
int depth;
|
||||
final int depth;
|
||||
|
||||
/** the enclosing translation context (set for nested lambdas/mref) */
|
||||
TranslationContext<?> prev;
|
||||
final TranslationContext<?> prev;
|
||||
|
||||
/** list of methods to be bridged by the meta-factory */
|
||||
List<Symbol> bridges;
|
||||
final List<Symbol> bridges;
|
||||
|
||||
TranslationContext(T tree) {
|
||||
this.tree = tree;
|
||||
@ -1688,6 +1684,31 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Name of the enclosing method to be folded into synthetic
|
||||
* method name
|
||||
*/
|
||||
String enclosingMethodName() {
|
||||
return syntheticMethodNameComponent(owner.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Method name in a form that can be folded into a
|
||||
* component of a synthetic method name
|
||||
*/
|
||||
String syntheticMethodNameComponent(Name name) {
|
||||
if (name == null) {
|
||||
return "null";
|
||||
}
|
||||
String methodName = name.toString();
|
||||
if (methodName.equals("<clinit>")) {
|
||||
methodName = "static";
|
||||
} else if (methodName.equals("<init>")) {
|
||||
methodName = "new";
|
||||
}
|
||||
return methodName;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1699,22 +1720,12 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
private class LambdaTranslationContext extends TranslationContext<JCLambda> {
|
||||
|
||||
/** variable in the enclosing context to which this lambda is assigned */
|
||||
Symbol self;
|
||||
final Symbol self;
|
||||
|
||||
/** map from original to translated lambda parameters */
|
||||
Map<Symbol, Symbol> lambdaParams = new LinkedHashMap<Symbol, Symbol>();
|
||||
/** variable in the enclosing context to which this lambda is assigned */
|
||||
final Symbol assignedTo;
|
||||
|
||||
/** map from original to translated lambda locals */
|
||||
Map<Symbol, Symbol> lambdaLocals = new LinkedHashMap<Symbol, Symbol>();
|
||||
|
||||
/** map from variables in enclosing scope to translated synthetic parameters */
|
||||
Map<Symbol, Symbol> capturedLocals = new LinkedHashMap<Symbol, Symbol>();
|
||||
|
||||
/** map from class symbols to translated synthetic parameters (for captured member access) */
|
||||
Map<Symbol, Symbol> capturedThis = new LinkedHashMap<Symbol, Symbol>();
|
||||
|
||||
/** map from original to translated lambda locals */
|
||||
Map<Symbol, Symbol> typeVars = new LinkedHashMap<Symbol, Symbol>();
|
||||
Map<LambdaSymbolKind, Map<Symbol, Symbol>> translatedSymbols;
|
||||
|
||||
/** the synthetic symbol for the method hoisting the translated lambda */
|
||||
Symbol translatedSym;
|
||||
@ -1724,14 +1735,110 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
LambdaTranslationContext(JCLambda tree) {
|
||||
super(tree);
|
||||
Frame frame = frameStack.head;
|
||||
if (frame.tree.hasTag(VARDEF)) {
|
||||
self = ((JCVariableDecl)frame.tree).sym;
|
||||
}
|
||||
Name name = isSerializable() ? serializedLambdaName(owner) : lambdaName();
|
||||
this.translatedSym = makePrivateSyntheticMethod(0, name, null, owner.enclClass());
|
||||
switch (frame.tree.getTag()) {
|
||||
case VARDEF:
|
||||
assignedTo = self = ((JCVariableDecl) frame.tree).sym;
|
||||
break;
|
||||
case ASSIGN:
|
||||
self = null;
|
||||
assignedTo = TreeInfo.symbol(((JCAssign) frame.tree).getVariable());
|
||||
break;
|
||||
default:
|
||||
assignedTo = self = null;
|
||||
break;
|
||||
}
|
||||
|
||||
// This symbol will be filled-in in complete
|
||||
this.translatedSym = makePrivateSyntheticMethod(0, null, null, owner.enclClass());
|
||||
|
||||
if (dumpLambdaToMethodStats) {
|
||||
log.note(tree, "lambda.stat", needsAltMetafactory(), translatedSym);
|
||||
}
|
||||
translatedSymbols = new EnumMap<>(LambdaSymbolKind.class);
|
||||
|
||||
translatedSymbols.put(PARAM, new LinkedHashMap<Symbol, Symbol>());
|
||||
translatedSymbols.put(LOCAL_VAR, new LinkedHashMap<Symbol, Symbol>());
|
||||
translatedSymbols.put(CAPTURED_VAR, new LinkedHashMap<Symbol, Symbol>());
|
||||
translatedSymbols.put(CAPTURED_THIS, new LinkedHashMap<Symbol, Symbol>());
|
||||
translatedSymbols.put(TYPE_VAR, new LinkedHashMap<Symbol, Symbol>());
|
||||
}
|
||||
|
||||
/**
|
||||
* For a serializable lambda, generate a disambiguating string
|
||||
* which maximizes stability across deserialization.
|
||||
*
|
||||
* @return String to differentiate synthetic lambda method names
|
||||
*/
|
||||
private String serializedLambdaDisambiguation() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
// Append the enclosing method signature to differentiate
|
||||
// overloaded enclosing methods. For lambdas enclosed in
|
||||
// lambdas, the generated lambda method will not have type yet,
|
||||
// but the enclosing method's name will have been generated
|
||||
// with this same method, so it will be unique and never be
|
||||
// overloaded.
|
||||
Assert.check(
|
||||
owner.type != null ||
|
||||
directlyEnclosingLambda() != null);
|
||||
if (owner.type != null) {
|
||||
buf.append(typeSig(owner.type));
|
||||
buf.append(":");
|
||||
}
|
||||
|
||||
// Add target type info
|
||||
buf.append(types.findDescriptorSymbol(tree.type.tsym).owner.flatName());
|
||||
buf.append(" ");
|
||||
|
||||
// Add variable assigned to
|
||||
if (assignedTo != null) {
|
||||
buf.append(assignedTo.flatName());
|
||||
buf.append("=");
|
||||
}
|
||||
//add captured locals info: type, name, order
|
||||
for (Symbol fv : getSymbolMap(CAPTURED_VAR).keySet()) {
|
||||
if (fv != self) {
|
||||
buf.append(typeSig(fv.type));
|
||||
buf.append(" ");
|
||||
buf.append(fv.flatName());
|
||||
buf.append(",");
|
||||
}
|
||||
}
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* For a non-serializable lambda, generate a simple method.
|
||||
*
|
||||
* @return Name to use for the synthetic lambda method name
|
||||
*/
|
||||
private Name lambdaName() {
|
||||
return names.lambda.append(names.fromString(enclosingMethodName() + "$" + lambdaCount++));
|
||||
}
|
||||
|
||||
/**
|
||||
* For a serializable lambda, generate a method name which maximizes
|
||||
* name stability across deserialization.
|
||||
*
|
||||
* @return Name to use for the synthetic lambda method name
|
||||
*/
|
||||
private Name serializedLambdaName() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append(names.lambda);
|
||||
// Append the name of the method enclosing the lambda.
|
||||
buf.append(enclosingMethodName());
|
||||
buf.append('$');
|
||||
// Append a hash of the disambiguating string : enclosing method
|
||||
// signature, etc.
|
||||
String disam = serializedLambdaDisambiguation();
|
||||
buf.append(Integer.toHexString(disam.hashCode()));
|
||||
buf.append('$');
|
||||
// The above appended name components may not be unique, append
|
||||
// a count based on the above name components.
|
||||
buf.append(syntheticMethodNameCounts.getIndex(buf));
|
||||
String result = buf.toString();
|
||||
//System.err.printf("serializedLambdaName: %s -- %s\n", result, disam);
|
||||
return names.fromString(result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1755,7 +1862,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
((VarSymbol)ret).pos = ((VarSymbol)sym).pos;
|
||||
break;
|
||||
case CAPTURED_VAR:
|
||||
ret = new VarSymbol(SYNTHETIC | FINAL, name, types.erasure(sym.type), translatedSym) {
|
||||
ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) {
|
||||
@Override
|
||||
public Symbol baseSymbol() {
|
||||
//keep mapping with original captured symbol
|
||||
@ -1763,8 +1870,17 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
};
|
||||
break;
|
||||
case LOCAL_VAR:
|
||||
ret = new VarSymbol(FINAL, name, types.erasure(sym.type), translatedSym);
|
||||
((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
|
||||
break;
|
||||
case PARAM:
|
||||
ret = new VarSymbol(FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym);
|
||||
((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
|
||||
break;
|
||||
default:
|
||||
ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
|
||||
((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
|
||||
}
|
||||
if (ret != sym) {
|
||||
ret.setDeclarationAttributes(sym.getRawAttributes());
|
||||
@ -1774,27 +1890,22 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
|
||||
void addSymbol(Symbol sym, LambdaSymbolKind skind) {
|
||||
Map<Symbol, Symbol> transMap = null;
|
||||
Map<Symbol, Symbol> transMap = getSymbolMap(skind);
|
||||
Name preferredName;
|
||||
switch (skind) {
|
||||
case CAPTURED_THIS:
|
||||
transMap = capturedThis;
|
||||
preferredName = names.fromString("encl$" + capturedThis.size());
|
||||
preferredName = names.fromString("encl$" + transMap.size());
|
||||
break;
|
||||
case CAPTURED_VAR:
|
||||
transMap = capturedLocals;
|
||||
preferredName = names.fromString("cap$" + capturedLocals.size());
|
||||
preferredName = names.fromString("cap$" + transMap.size());
|
||||
break;
|
||||
case LOCAL_VAR:
|
||||
transMap = lambdaLocals;
|
||||
preferredName = sym.name;
|
||||
break;
|
||||
case PARAM:
|
||||
transMap = lambdaParams;
|
||||
preferredName = sym.name;
|
||||
break;
|
||||
case TYPE_VAR:
|
||||
transMap = typeVars;
|
||||
preferredName = sym.name;
|
||||
break;
|
||||
default: throw new AssertionError();
|
||||
@ -1804,29 +1915,22 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
}
|
||||
|
||||
Map<Symbol, Symbol> getSymbolMap(LambdaSymbolKind... skinds) {
|
||||
LinkedHashMap<Symbol, Symbol> translationMap = new LinkedHashMap<Symbol, Symbol>();
|
||||
for (LambdaSymbolKind skind : skinds) {
|
||||
switch (skind) {
|
||||
case CAPTURED_THIS:
|
||||
translationMap.putAll(capturedThis);
|
||||
break;
|
||||
case CAPTURED_VAR:
|
||||
translationMap.putAll(capturedLocals);
|
||||
break;
|
||||
case LOCAL_VAR:
|
||||
translationMap.putAll(lambdaLocals);
|
||||
break;
|
||||
case PARAM:
|
||||
translationMap.putAll(lambdaParams);
|
||||
break;
|
||||
case TYPE_VAR:
|
||||
translationMap.putAll(typeVars);
|
||||
break;
|
||||
default: throw new AssertionError();
|
||||
Map<Symbol, Symbol> getSymbolMap(LambdaSymbolKind skind) {
|
||||
Map<Symbol, Symbol> m = translatedSymbols.get(skind);
|
||||
Assert.checkNonNull(m);
|
||||
return m;
|
||||
}
|
||||
|
||||
JCTree translate(JCIdent lambdaIdent) {
|
||||
for (Map<Symbol, Symbol> m : translatedSymbols.values()) {
|
||||
if (m.containsKey(lambdaIdent.sym)) {
|
||||
Symbol tSym = m.get(lambdaIdent.sym);
|
||||
JCTree t = make.Ident(tSym).setType(lambdaIdent.type);
|
||||
tSym.setTypeAttributes(lambdaIdent.sym.getRawTypeAttributes());
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return translationMap;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1845,7 +1949,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
// If instance access isn't needed, make it static.
|
||||
// Interface instance methods must be default methods.
|
||||
// Lambda methods are private synthetic.
|
||||
translatedSym.flags_field = SYNTHETIC |
|
||||
translatedSym.flags_field = SYNTHETIC | LAMBDA_METHOD |
|
||||
PRIVATE |
|
||||
(thisReferenced? (inInterface? DEFAULT : 0) : STATIC);
|
||||
|
||||
@ -1857,12 +1961,19 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
//
|
||||
// 1) reference to enclosing contexts captured by the lambda expression
|
||||
// 2) enclosing locals captured by the lambda expression
|
||||
for (Symbol thisSym : getSymbolMap(CAPTURED_VAR, PARAM).values()) {
|
||||
for (Symbol thisSym : getSymbolMap(CAPTURED_VAR).values()) {
|
||||
params.append(make.VarDef((VarSymbol) thisSym, null));
|
||||
}
|
||||
for (Symbol thisSym : getSymbolMap(PARAM).values()) {
|
||||
params.append(make.VarDef((VarSymbol) thisSym, null));
|
||||
}
|
||||
|
||||
syntheticParams = params.toList();
|
||||
|
||||
// Compute and set the lambda name
|
||||
translatedSym.name = isSerializable()
|
||||
? serializedLambdaName()
|
||||
: lambdaName();
|
||||
|
||||
//prepend synthetic args to translated lambda method signature
|
||||
translatedSym.type = types.createMethodTypeWithParameters(
|
||||
generatedLambdaSig(),
|
||||
@ -1890,7 +2001,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
this.isSuper = tree.hasKind(ReferenceKind.SUPER);
|
||||
this.bridgeSym = needsBridge()
|
||||
? makePrivateSyntheticMethod(isSuper ? 0 : STATIC,
|
||||
lambdaName().append(names.fromString("$bridge")), null,
|
||||
referenceBridgeName(), null,
|
||||
owner.enclClass())
|
||||
: null;
|
||||
if (dumpLambdaToMethodStats) {
|
||||
@ -1904,13 +2015,71 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
* Get the opcode associated with this method reference
|
||||
*/
|
||||
int referenceKind() {
|
||||
return LambdaToMethod.this.referenceKind(needsBridge() ? bridgeSym : tree.sym);
|
||||
return LambdaToMethod.this.referenceKind(needsBridge()
|
||||
? bridgeSym
|
||||
: tree.sym);
|
||||
}
|
||||
|
||||
boolean needsVarArgsConversion() {
|
||||
return tree.varargsElement != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a disambiguating string to increase stability (important
|
||||
* if serialized)
|
||||
*
|
||||
* @return String to differentiate synthetic lambda method names
|
||||
*/
|
||||
private String referenceBridgeDisambiguation() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
// Append the enclosing method signature to differentiate
|
||||
// overloaded enclosing methods.
|
||||
if (owner.type != null) {
|
||||
buf.append(typeSig(owner.type));
|
||||
buf.append(":");
|
||||
}
|
||||
|
||||
// Append qualifier type
|
||||
buf.append(classSig(tree.sym.owner.type));
|
||||
|
||||
// Note static/instance
|
||||
buf.append(tree.sym.isStatic()? " S " : " I ");
|
||||
|
||||
// Append referenced signature
|
||||
buf.append(typeSig(tree.sym.erasure(types)));
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a unique stable name for the method reference bridge
|
||||
*
|
||||
* @return Name to use for the synthetic method name
|
||||
*/
|
||||
private Name referenceBridgeName() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
// Append lambda ID, this is semantically significant
|
||||
buf.append(names.lambda);
|
||||
// Note that it is a method reference bridge
|
||||
buf.append("MR$");
|
||||
// Append the enclosing method name
|
||||
buf.append(enclosingMethodName());
|
||||
buf.append('$');
|
||||
// Append the referenced method name
|
||||
buf.append(syntheticMethodNameComponent(tree.sym.name));
|
||||
buf.append('$');
|
||||
// Append a hash of the disambiguating string : enclosing method
|
||||
// signature, etc.
|
||||
String disam = referenceBridgeDisambiguation();
|
||||
buf.append(Integer.toHexString(disam.hashCode()));
|
||||
buf.append('$');
|
||||
// The above appended name components may not be unique, append
|
||||
// a count based on the above name components.
|
||||
buf.append(syntheticMethodNameCounts.getIndex(buf));
|
||||
String result = buf.toString();
|
||||
return names.fromString(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Is this an array operation like clone()
|
||||
*/
|
||||
@ -1918,13 +2087,6 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
return tree.sym.owner == syms.arrayClass;
|
||||
}
|
||||
|
||||
boolean isPrivateConstructor() {
|
||||
//hack needed to workaround 292 bug (8005122)
|
||||
//when 292 issue is fixed we should simply remove this
|
||||
return tree.sym.name == names.init &&
|
||||
(tree.sym.flags() & PRIVATE) != 0;
|
||||
}
|
||||
|
||||
boolean receiverAccessible() {
|
||||
//hack needed to workaround 292 bug (7087658)
|
||||
//when 292 issue is fixed we should remove this and change the backend
|
||||
@ -1932,13 +2094,25 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
return tree.ownerAccessible;
|
||||
}
|
||||
|
||||
/**
|
||||
* The VM does not support access across nested classes (8010319).
|
||||
* Were that ever to change, this should be removed.
|
||||
*/
|
||||
boolean isPrivateInOtherClass() {
|
||||
return (tree.sym.flags() & PRIVATE) != 0 &&
|
||||
!types.isSameType(
|
||||
types.erasure(tree.sym.enclClass().asType()),
|
||||
types.erasure(owner.enclClass().asType()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this reference needs a bridge (i.e. var args need to be
|
||||
* expanded or "super" is used)
|
||||
*/
|
||||
final boolean needsBridge() {
|
||||
return isSuper || needsVarArgsConversion() || isArrayOp() ||
|
||||
isPrivateConstructor() || !receiverAccessible();
|
||||
isPrivateInOtherClass() ||
|
||||
!receiverAccessible();
|
||||
}
|
||||
|
||||
Type generatedRefSig() {
|
||||
@ -1952,12 +2126,16 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
/*
|
||||
* These keys provide mappings for various translated lambda symbols
|
||||
* and the prevailing order must be maintained.
|
||||
*/
|
||||
enum LambdaSymbolKind {
|
||||
CAPTURED_VAR,
|
||||
CAPTURED_THIS,
|
||||
LOCAL_VAR,
|
||||
PARAM,
|
||||
TYPE_VAR;
|
||||
PARAM, // original to translated lambda parameters
|
||||
LOCAL_VAR, // original to translated lambda locals
|
||||
CAPTURED_VAR, // variables in enclosing scope to translated synthetic parameters
|
||||
CAPTURED_THIS, // class symbols to translated synthetic parameters (for captured member access)
|
||||
TYPE_VAR; // original to translated lambda type variables
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1966,7 +2144,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
* ****************************************************************
|
||||
*/
|
||||
|
||||
private String methodSig(Type type) {
|
||||
private String typeSig(Type type) {
|
||||
L2MSignatureGenerator sg = new L2MSignatureGenerator();
|
||||
sg.assembleSig(type);
|
||||
return sg.toString();
|
||||
|
@ -573,45 +573,51 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
|
||||
|
||||
Env<AttrContext> localEnv = methodEnv(tree, env);
|
||||
|
||||
DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
|
||||
annotate.enterStart();
|
||||
try {
|
||||
// Compute the method type
|
||||
m.type = signature(m, tree.typarams, tree.params,
|
||||
tree.restype, tree.recvparam,
|
||||
tree.thrown,
|
||||
localEnv);
|
||||
} finally {
|
||||
deferredLintHandler.setPos(prevLintPos);
|
||||
}
|
||||
DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
|
||||
try {
|
||||
// Compute the method type
|
||||
m.type = signature(m, tree.typarams, tree.params,
|
||||
tree.restype, tree.recvparam,
|
||||
tree.thrown,
|
||||
localEnv);
|
||||
} finally {
|
||||
deferredLintHandler.setPos(prevLintPos);
|
||||
}
|
||||
|
||||
if (types.isSignaturePolymorphic(m)) {
|
||||
m.flags_field |= SIGNATURE_POLYMORPHIC;
|
||||
}
|
||||
if (types.isSignaturePolymorphic(m)) {
|
||||
m.flags_field |= SIGNATURE_POLYMORPHIC;
|
||||
}
|
||||
|
||||
// Set m.params
|
||||
ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>();
|
||||
JCVariableDecl lastParam = null;
|
||||
for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
|
||||
JCVariableDecl param = lastParam = l.head;
|
||||
params.append(Assert.checkNonNull(param.sym));
|
||||
}
|
||||
m.params = params.toList();
|
||||
// Set m.params
|
||||
ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>();
|
||||
JCVariableDecl lastParam = null;
|
||||
for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
|
||||
JCVariableDecl param = lastParam = l.head;
|
||||
params.append(Assert.checkNonNull(param.sym));
|
||||
}
|
||||
m.params = params.toList();
|
||||
|
||||
// mark the method varargs, if necessary
|
||||
if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
|
||||
m.flags_field |= Flags.VARARGS;
|
||||
// mark the method varargs, if necessary
|
||||
if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
|
||||
m.flags_field |= Flags.VARARGS;
|
||||
|
||||
localEnv.info.scope.leave();
|
||||
if (chk.checkUnique(tree.pos(), m, enclScope)) {
|
||||
localEnv.info.scope.leave();
|
||||
if (chk.checkUnique(tree.pos(), m, enclScope)) {
|
||||
enclScope.enter(m);
|
||||
}
|
||||
annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
|
||||
// Visit the signature of the method. Note that
|
||||
// TypeAnnotate doesn't descend into the body.
|
||||
typeAnnotate(tree, localEnv, m, tree.pos());
|
||||
}
|
||||
|
||||
if (tree.defaultValue != null)
|
||||
annotateDefaultValueLater(tree.defaultValue, localEnv, m);
|
||||
annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
|
||||
// Visit the signature of the method. Note that
|
||||
// TypeAnnotate doesn't descend into the body.
|
||||
typeAnnotate(tree, localEnv, m, tree.pos());
|
||||
|
||||
if (tree.defaultValue != null)
|
||||
annotateDefaultValueLater(tree.defaultValue, localEnv, m);
|
||||
} finally {
|
||||
annotate.enterDone();
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a fresh environment for method bodies.
|
||||
@ -639,61 +645,68 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
|
||||
localEnv.info.staticLevel++;
|
||||
}
|
||||
DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
|
||||
annotate.enterStart();
|
||||
try {
|
||||
if (TreeInfo.isEnumInit(tree)) {
|
||||
attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
|
||||
} else {
|
||||
attr.attribType(tree.vartype, localEnv);
|
||||
if (tree.nameexpr != null) {
|
||||
attr.attribExpr(tree.nameexpr, localEnv);
|
||||
MethodSymbol m = localEnv.enclMethod.sym;
|
||||
if (m.isConstructor()) {
|
||||
Type outertype = m.owner.owner.type;
|
||||
if (outertype.hasTag(TypeTag.CLASS)) {
|
||||
checkType(tree.vartype, outertype, "incorrect.constructor.receiver.type");
|
||||
checkType(tree.nameexpr, outertype, "incorrect.constructor.receiver.name");
|
||||
try {
|
||||
if (TreeInfo.isEnumInit(tree)) {
|
||||
attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
|
||||
} else {
|
||||
attr.attribType(tree.vartype, localEnv);
|
||||
if (tree.nameexpr != null) {
|
||||
attr.attribExpr(tree.nameexpr, localEnv);
|
||||
MethodSymbol m = localEnv.enclMethod.sym;
|
||||
if (m.isConstructor()) {
|
||||
Type outertype = m.owner.owner.type;
|
||||
if (outertype.hasTag(TypeTag.CLASS)) {
|
||||
checkType(tree.vartype, outertype, "incorrect.constructor.receiver.type");
|
||||
checkType(tree.nameexpr, outertype, "incorrect.constructor.receiver.name");
|
||||
} else {
|
||||
log.error(tree, "receiver.parameter.not.applicable.constructor.toplevel.class");
|
||||
}
|
||||
} else {
|
||||
log.error(tree, "receiver.parameter.not.applicable.constructor.toplevel.class");
|
||||
checkType(tree.vartype, m.owner.type, "incorrect.receiver.type");
|
||||
checkType(tree.nameexpr, m.owner.type, "incorrect.receiver.name");
|
||||
}
|
||||
} else {
|
||||
checkType(tree.vartype, m.owner.type, "incorrect.receiver.type");
|
||||
checkType(tree.nameexpr, m.owner.type, "incorrect.receiver.name");
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
deferredLintHandler.setPos(prevLintPos);
|
||||
}
|
||||
} finally {
|
||||
deferredLintHandler.setPos(prevLintPos);
|
||||
}
|
||||
|
||||
if ((tree.mods.flags & VARARGS) != 0) {
|
||||
//if we are entering a varargs parameter, we need to replace its type
|
||||
//(a plain array type) with the more precise VarargsType --- we need
|
||||
//to do it this way because varargs is represented in the tree as a modifier
|
||||
//on the parameter declaration, and not as a distinct type of array node.
|
||||
ArrayType atype = (ArrayType)tree.vartype.type.unannotatedType();
|
||||
tree.vartype.type = atype.makeVarargs();
|
||||
}
|
||||
Scope enclScope = enter.enterScope(env);
|
||||
VarSymbol v =
|
||||
new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);
|
||||
v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
|
||||
tree.sym = v;
|
||||
if (tree.init != null) {
|
||||
v.flags_field |= HASINIT;
|
||||
if ((v.flags_field & FINAL) != 0 &&
|
||||
needsLazyConstValue(tree.init)) {
|
||||
Env<AttrContext> initEnv = getInitEnv(tree, env);
|
||||
initEnv.info.enclVar = v;
|
||||
v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
|
||||
if ((tree.mods.flags & VARARGS) != 0) {
|
||||
//if we are entering a varargs parameter, we need to
|
||||
//replace its type (a plain array type) with the more
|
||||
//precise VarargsType --- we need to do it this way
|
||||
//because varargs is represented in the tree as a
|
||||
//modifier on the parameter declaration, and not as a
|
||||
//distinct type of array node.
|
||||
ArrayType atype = (ArrayType)tree.vartype.type.unannotatedType();
|
||||
tree.vartype.type = atype.makeVarargs();
|
||||
}
|
||||
Scope enclScope = enter.enterScope(env);
|
||||
VarSymbol v =
|
||||
new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);
|
||||
v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
|
||||
tree.sym = v;
|
||||
if (tree.init != null) {
|
||||
v.flags_field |= HASINIT;
|
||||
if ((v.flags_field & FINAL) != 0 &&
|
||||
needsLazyConstValue(tree.init)) {
|
||||
Env<AttrContext> initEnv = getInitEnv(tree, env);
|
||||
initEnv.info.enclVar = v;
|
||||
v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
|
||||
}
|
||||
}
|
||||
if (chk.checkUnique(tree.pos(), v, enclScope)) {
|
||||
chk.checkTransparentVar(tree.pos(), v, enclScope);
|
||||
enclScope.enter(v);
|
||||
}
|
||||
annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
|
||||
typeAnnotate(tree.vartype, env, v, tree.pos());
|
||||
v.pos = tree.pos;
|
||||
} finally {
|
||||
annotate.enterDone();
|
||||
}
|
||||
if (chk.checkUnique(tree.pos(), v, enclScope)) {
|
||||
chk.checkTransparentVar(tree.pos(), v, enclScope);
|
||||
enclScope.enter(v);
|
||||
}
|
||||
annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
|
||||
typeAnnotate(tree.vartype, env, v, tree.pos());
|
||||
v.pos = tree.pos;
|
||||
}
|
||||
// where
|
||||
void checkType(JCTree tree, Type type, String diag) {
|
||||
|
@ -1652,9 +1652,10 @@ public class Gen extends JCTree.Visitor {
|
||||
startpc, end, code.curCP(),
|
||||
catchType);
|
||||
if (subCatch.type.isAnnotated()) {
|
||||
// All compounds share the same position, simply update the
|
||||
// first one.
|
||||
subCatch.type.getAnnotationMirrors().head.position.type_index = catchType;
|
||||
for (Attribute.TypeCompound tc :
|
||||
subCatch.type.getAnnotationMirrors()) {
|
||||
tc.position.type_index = catchType;
|
||||
}
|
||||
}
|
||||
}
|
||||
gaps = gaps.tail;
|
||||
@ -1668,9 +1669,10 @@ public class Gen extends JCTree.Visitor {
|
||||
startpc, endpc, code.curCP(),
|
||||
catchType);
|
||||
if (subCatch.type.isAnnotated()) {
|
||||
// All compounds share the same position, simply update the
|
||||
// first one.
|
||||
subCatch.type.getAnnotationMirrors().head.position.type_index = catchType;
|
||||
for (Attribute.TypeCompound tc :
|
||||
subCatch.type.getAnnotationMirrors()) {
|
||||
tc.position.type_index = catchType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2892,7 +2894,8 @@ public class Gen extends JCTree.Visitor {
|
||||
|
||||
@Override
|
||||
public void visitMethodDef(JCMethodDecl tree) {
|
||||
if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0) {
|
||||
if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0
|
||||
&& (tree.sym.flags() & LAMBDA_METHOD) == 0) {
|
||||
return;
|
||||
}
|
||||
if (tree.name.equals(names.clinit)) {
|
||||
@ -2906,6 +2909,7 @@ public class Gen extends JCTree.Visitor {
|
||||
return;
|
||||
}
|
||||
currentMethod = tree.sym;
|
||||
|
||||
super.visitMethodDef(tree);
|
||||
}
|
||||
|
||||
|
@ -271,10 +271,6 @@ public class JavaCompiler {
|
||||
*/
|
||||
protected TransTypes transTypes;
|
||||
|
||||
/** The lambda translator.
|
||||
*/
|
||||
protected LambdaToMethod lambdaToMethod;
|
||||
|
||||
/** The syntactic sugar desweetener.
|
||||
*/
|
||||
protected Lower lower;
|
||||
@ -388,8 +384,6 @@ public class JavaCompiler {
|
||||
|
||||
options = Options.instance(context);
|
||||
|
||||
lambdaToMethod = LambdaToMethod.instance(context);
|
||||
|
||||
verbose = options.isSet(VERBOSE);
|
||||
sourceOutput = options.isSet(PRINTSOURCE); // used to be -s
|
||||
stubOutput = options.isSet("-stubs");
|
||||
@ -1393,6 +1387,7 @@ public class JavaCompiler {
|
||||
*/
|
||||
class ScanNested extends TreeScanner {
|
||||
Set<Env<AttrContext>> dependencies = new LinkedHashSet<Env<AttrContext>>();
|
||||
protected boolean hasLambdas;
|
||||
@Override
|
||||
public void visitClassDef(JCClassDecl node) {
|
||||
Type st = types.supertype(node.sym.type);
|
||||
@ -1402,7 +1397,18 @@ public class JavaCompiler {
|
||||
Env<AttrContext> stEnv = enter.getEnv(c);
|
||||
if (stEnv != null && env != stEnv) {
|
||||
if (dependencies.add(stEnv)) {
|
||||
scan(stEnv.tree);
|
||||
boolean prevHasLambdas = hasLambdas;
|
||||
try {
|
||||
scan(stEnv.tree);
|
||||
} finally {
|
||||
/*
|
||||
* ignore any updates to hasLambdas made during
|
||||
* the nested scan, this ensures an initalized
|
||||
* LambdaToMethod is available only to those
|
||||
* classes that contain lambdas
|
||||
*/
|
||||
hasLambdas = prevHasLambdas;
|
||||
}
|
||||
}
|
||||
envForSuperTypeFound = true;
|
||||
}
|
||||
@ -1410,6 +1416,16 @@ public class JavaCompiler {
|
||||
}
|
||||
super.visitClassDef(node);
|
||||
}
|
||||
@Override
|
||||
public void visitLambda(JCLambda tree) {
|
||||
hasLambdas = true;
|
||||
super.visitLambda(tree);
|
||||
}
|
||||
@Override
|
||||
public void visitReference(JCMemberReference tree) {
|
||||
hasLambdas = true;
|
||||
super.visitReference(tree);
|
||||
}
|
||||
}
|
||||
ScanNested scanner = new ScanNested();
|
||||
scanner.scan(env.tree);
|
||||
@ -1468,11 +1484,11 @@ public class JavaCompiler {
|
||||
env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
|
||||
compileStates.put(env, CompileState.TRANSTYPES);
|
||||
|
||||
if (source.allowLambda()) {
|
||||
if (source.allowLambda() && scanner.hasLambdas) {
|
||||
if (shouldStop(CompileState.UNLAMBDA))
|
||||
return;
|
||||
|
||||
env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake);
|
||||
env.tree = LambdaToMethod.instance(context).translateTopLevelClass(env, env.tree, localMake);
|
||||
compileStates.put(env, CompileState.UNLAMBDA);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2013, 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
|
||||
@ -184,19 +184,19 @@ public class JavacMessages implements Messages {
|
||||
String key,
|
||||
Object... args) {
|
||||
String msg = null;
|
||||
for (List<ResourceBundle> l = bundles; l.nonEmpty() && msg == null; l = l.tail) {
|
||||
ResourceBundle rb = l.head;
|
||||
try {
|
||||
msg = rb.getString(key);
|
||||
}
|
||||
catch (MissingResourceException e) {
|
||||
// ignore, try other bundles in list
|
||||
}
|
||||
}
|
||||
if (msg == null) {
|
||||
msg = "compiler message file broken: key=" + key +
|
||||
" arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}";
|
||||
}
|
||||
return MessageFormat.format(msg, args);
|
||||
for (List<ResourceBundle> l = bundles; l.nonEmpty() && msg == null; l = l.tail) {
|
||||
ResourceBundle rb = l.head;
|
||||
try {
|
||||
msg = rb.getString(key);
|
||||
}
|
||||
catch (MissingResourceException e) {
|
||||
// ignore, try other bundles in list
|
||||
}
|
||||
}
|
||||
if (msg == null) {
|
||||
msg = "compiler message file broken: key=" + key +
|
||||
" arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}";
|
||||
}
|
||||
return MessageFormat.format(msg, args);
|
||||
}
|
||||
}
|
||||
|
@ -800,7 +800,7 @@ public class DocEnv {
|
||||
return result;
|
||||
}
|
||||
|
||||
void initDoclint(Collection<String> opts) {
|
||||
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
|
||||
ArrayList<String> doclintOpts = new ArrayList<String>();
|
||||
|
||||
for (String opt: opts) {
|
||||
@ -814,6 +814,15 @@ public class DocEnv {
|
||||
return;
|
||||
}
|
||||
|
||||
String sep = "";
|
||||
StringBuilder customTags = new StringBuilder();
|
||||
for (String customTag : customTagNames) {
|
||||
customTags.append(sep);
|
||||
customTags.append(customTag);
|
||||
sep = DocLint.TAGS_SEPARATOR;
|
||||
}
|
||||
doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
|
||||
|
||||
JavacTask t = BasicJavacTask.instance(context);
|
||||
doclint = new DocLint();
|
||||
// standard doclet normally generates H1, H2
|
||||
|
@ -377,8 +377,8 @@ public class RootDocImpl extends DocImpl implements RootDoc {
|
||||
return env.fileManager;
|
||||
}
|
||||
|
||||
public void initDocLint(Collection<String> opts) {
|
||||
env.initDoclint(opts);
|
||||
public void initDocLint(Collection<String> opts, Collection<String> customTagNames) {
|
||||
env.initDoclint(opts, customTagNames);
|
||||
}
|
||||
|
||||
public boolean showTagMessages() {
|
||||
|
@ -26,9 +26,11 @@ package com.sun.tools.jdeps;
|
||||
|
||||
import com.sun.tools.classfile.Dependency.Location;
|
||||
import com.sun.tools.jdeps.PlatformClassPath.JDKArchive;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.SortedSet;
|
||||
@ -52,7 +54,7 @@ public class Analyzer {
|
||||
|
||||
private final Type type;
|
||||
private final Map<Archive, ArchiveDeps> results = new HashMap<>();
|
||||
private final Map<String, Archive> map = new HashMap<>();
|
||||
private final Map<Location, Archive> map = new HashMap<>();
|
||||
private final Archive NOT_FOUND
|
||||
= new Archive(JdepsTask.getMessage("artifact.not.found"));
|
||||
|
||||
@ -69,6 +71,17 @@ public class Analyzer {
|
||||
* Performs the dependency analysis on the given archives.
|
||||
*/
|
||||
public void run(List<Archive> archives) {
|
||||
// build a map from Location to Archive
|
||||
for (Archive archive: archives) {
|
||||
for (Location l: archive.getClasses()) {
|
||||
if (!map.containsKey(l)) {
|
||||
map.put(l, archive);
|
||||
} else {
|
||||
// duplicated class warning?
|
||||
}
|
||||
}
|
||||
}
|
||||
// traverse and analyze all dependencies
|
||||
for (Archive archive : archives) {
|
||||
ArchiveDeps deps;
|
||||
if (type == Type.CLASS || type == Type.VERBOSE) {
|
||||
@ -76,33 +89,9 @@ public class Analyzer {
|
||||
} else {
|
||||
deps = new PackageVisitor(archive);
|
||||
}
|
||||
archive.visit(deps);
|
||||
archive.visitDependences(deps);
|
||||
results.put(archive, deps);
|
||||
}
|
||||
|
||||
// set the required dependencies
|
||||
for (ArchiveDeps result: results.values()) {
|
||||
for (Set<String> set : result.deps.values()) {
|
||||
for (String target : set) {
|
||||
Archive source = getArchive(target);
|
||||
if (result.archive != source) {
|
||||
String profile = "";
|
||||
if (source instanceof JDKArchive) {
|
||||
profile = result.profile != null ? result.profile.toString() : "";
|
||||
if (result.getTargetProfile(target) == null) {
|
||||
profile += ", JDK internal API";
|
||||
// override the value if it accesses any JDK internal
|
||||
result.requireArchives.put(source, profile);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!result.requireArchives.containsKey(source)) {
|
||||
result.requireArchives.put(source, profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasDependences(Archive archive) {
|
||||
@ -117,94 +106,143 @@ public class Analyzer {
|
||||
* Visits the source archive to its destination archive of
|
||||
* a recorded dependency.
|
||||
*/
|
||||
void visitArchiveDependence(Archive origin, Archive target, String profile);
|
||||
void visitArchiveDependence(Archive origin, Archive target, Profile profile);
|
||||
/**
|
||||
* Visits a recorded dependency from origin to target which can be
|
||||
* a fully-qualified classname, a package name, a profile or
|
||||
* archive name depending on the Analyzer's type.
|
||||
*/
|
||||
void visitDependence(String origin, Archive source, String target, Archive archive, String profile);
|
||||
void visitDependence(String origin, Archive source, String target, Archive archive, Profile profile);
|
||||
}
|
||||
|
||||
public void visitArchiveDependences(Archive source, Visitor v) {
|
||||
ArchiveDeps r = results.get(source);
|
||||
for (Map.Entry<Archive,String> e : r.requireArchives.entrySet()) {
|
||||
v.visitArchiveDependence(r.archive, e.getKey(), e.getValue());
|
||||
for (ArchiveDeps.Dep d: r.requireArchives()) {
|
||||
v.visitArchiveDependence(r.archive, d.archive, d.profile);
|
||||
}
|
||||
}
|
||||
|
||||
public void visitDependences(Archive source, Visitor v) {
|
||||
ArchiveDeps r = results.get(source);
|
||||
for (String origin : r.deps.keySet()) {
|
||||
for (String target : r.deps.get(origin)) {
|
||||
Archive archive = getArchive(target);
|
||||
assert source == getArchive(origin);
|
||||
Profile profile = r.getTargetProfile(target);
|
||||
|
||||
for (Map.Entry<String, SortedSet<ArchiveDeps.Dep>> e: r.deps.entrySet()) {
|
||||
String origin = e.getKey();
|
||||
for (ArchiveDeps.Dep d: e.getValue()) {
|
||||
// filter intra-dependency unless in verbose mode
|
||||
if (type == Type.VERBOSE || archive != source) {
|
||||
v.visitDependence(origin, source, target, archive,
|
||||
profile != null ? profile.toString() : "");
|
||||
if (type == Type.VERBOSE || d.archive != source) {
|
||||
v.visitDependence(origin, source, d.target, d.archive, d.profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Archive getArchive(String name) {
|
||||
return map.containsKey(name) ? map.get(name) : NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
* ArchiveDeps contains the dependencies for an Archive that
|
||||
* can have one or more classes.
|
||||
*/
|
||||
private abstract class ArchiveDeps implements Archive.Visitor {
|
||||
final Archive archive;
|
||||
final Map<Archive,String> requireArchives;
|
||||
final SortedMap<String, SortedSet<String>> deps;
|
||||
Profile profile = null;
|
||||
final SortedMap<String, SortedSet<Dep>> deps;
|
||||
ArchiveDeps(Archive archive) {
|
||||
this.archive = archive;
|
||||
this.requireArchives = new HashMap<>();
|
||||
this.deps = new TreeMap<>();
|
||||
}
|
||||
|
||||
void add(String loc) {
|
||||
Archive a = map.get(loc);
|
||||
if (a == null) {
|
||||
map.put(loc, archive);
|
||||
} else if (a != archive) {
|
||||
// duplicated class warning?
|
||||
}
|
||||
}
|
||||
|
||||
void add(String origin, String target) {
|
||||
SortedSet<String> set = deps.get(origin);
|
||||
void add(String origin, String target, Archive targetArchive, String pkgName) {
|
||||
SortedSet<Dep> set = deps.get(origin);
|
||||
if (set == null) {
|
||||
deps.put(origin, set = new TreeSet<>());
|
||||
}
|
||||
if (!set.contains(target)) {
|
||||
set.add(target);
|
||||
// find the corresponding profile
|
||||
Profile p = getTargetProfile(target);
|
||||
if (profile == null || (p != null && profile.profile < p.profile)) {
|
||||
profile = p;
|
||||
Profile p = targetArchive instanceof JDKArchive
|
||||
? Profile.getProfile(pkgName) : null;
|
||||
set.add(new Dep(target, targetArchive, p));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of Archive dependences. The returned
|
||||
* list contains one {@code Dep} instance per one archive
|
||||
* and with the minimum profile this archive depends on.
|
||||
*/
|
||||
List<Dep> requireArchives() {
|
||||
Map<Archive,Profile> map = new HashMap<>();
|
||||
for (Set<Dep> set: deps.values()) {
|
||||
for (Dep d: set) {
|
||||
if (this.archive != d.archive) {
|
||||
Profile p = map.get(d.archive);
|
||||
if (p == null || (d.profile != null && p.profile < d.profile.profile)) {
|
||||
map.put(d.archive, d.profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
List<Dep> list = new ArrayList<>();
|
||||
for (Map.Entry<Archive,Profile> e: map.entrySet()) {
|
||||
list.add(new Dep("", e.getKey(), e.getValue()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dep represents a dependence where the target can be
|
||||
* a classname or packagename and the archive and profile
|
||||
* the target belongs to.
|
||||
*/
|
||||
class Dep implements Comparable<Dep> {
|
||||
final String target;
|
||||
final Archive archive;
|
||||
final Profile profile;
|
||||
Dep(String target, Archive archive, Profile p) {
|
||||
this.target = target;
|
||||
this.archive = archive;
|
||||
this.profile = p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof Dep) {
|
||||
Dep d = (Dep)o;
|
||||
return this.archive == d.archive && this.target.equals(d.target);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
hash = 17 * hash + Objects.hashCode(this.archive);
|
||||
hash = 17 * hash + Objects.hashCode(this.target);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Dep o) {
|
||||
if (this.target.equals(o.target)) {
|
||||
if (this.archive == o.archive) {
|
||||
return 0;
|
||||
} else {
|
||||
return this.archive.getFileName().compareTo(o.archive.getFileName());
|
||||
}
|
||||
}
|
||||
return this.target.compareTo(o.target);
|
||||
}
|
||||
}
|
||||
public abstract void visit(Location o, Location t);
|
||||
public abstract Profile getTargetProfile(String target);
|
||||
}
|
||||
|
||||
private class ClassVisitor extends ArchiveDeps {
|
||||
ClassVisitor(Archive archive) {
|
||||
super(archive);
|
||||
}
|
||||
public void visit(Location l) {
|
||||
add(l.getClassName());
|
||||
}
|
||||
@Override
|
||||
public void visit(Location o, Location t) {
|
||||
add(o.getClassName(), t.getClassName());
|
||||
}
|
||||
public Profile getTargetProfile(String target) {
|
||||
int i = target.lastIndexOf('.');
|
||||
return (i > 0) ? Profile.getProfile(target.substring(0, i)) : null;
|
||||
Archive targetArchive =
|
||||
this.archive.getClasses().contains(t) ? this.archive : map.get(t);
|
||||
if (targetArchive == null) {
|
||||
map.put(t, targetArchive = NOT_FOUND);
|
||||
}
|
||||
|
||||
String origin = o.getClassName();
|
||||
String target = t.getClassName();
|
||||
add(origin, target, targetArchive, t.getPackageName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,18 +250,21 @@ public class Analyzer {
|
||||
PackageVisitor(Archive archive) {
|
||||
super(archive);
|
||||
}
|
||||
@Override
|
||||
public void visit(Location o, Location t) {
|
||||
add(packageOf(o), packageOf(t));
|
||||
Archive targetArchive =
|
||||
this.archive.getClasses().contains(t) ? this.archive : map.get(t);
|
||||
if (targetArchive == null) {
|
||||
map.put(t, targetArchive = NOT_FOUND);
|
||||
}
|
||||
|
||||
String origin = packageOf(o);
|
||||
String target = packageOf(t);
|
||||
add(origin, target, targetArchive, t.getPackageName());
|
||||
}
|
||||
public void visit(Location l) {
|
||||
add(packageOf(l));
|
||||
}
|
||||
private String packageOf(Location loc) {
|
||||
String pkg = loc.getPackageName();
|
||||
public String packageOf(Location o) {
|
||||
String pkg = o.getPackageName();
|
||||
return pkg.isEmpty() ? "<unnamed>" : pkg;
|
||||
}
|
||||
public Profile getTargetProfile(String target) {
|
||||
return Profile.getProfile(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ public class Archive {
|
||||
deps.put(origin, set);
|
||||
}
|
||||
}
|
||||
|
||||
public void addClass(Location origin, Location target) {
|
||||
Set<Location> set = deps.get(origin);
|
||||
if (set == null) {
|
||||
@ -76,21 +77,27 @@ public class Archive {
|
||||
set.add(target);
|
||||
}
|
||||
|
||||
public void visit(Visitor v) {
|
||||
public Set<Location> getClasses() {
|
||||
return deps.keySet();
|
||||
}
|
||||
|
||||
public void visitDependences(Visitor v) {
|
||||
for (Map.Entry<Location,Set<Location>> e: deps.entrySet()) {
|
||||
v.visit(e.getKey());
|
||||
for (Location target : e.getValue()) {
|
||||
v.visit(e.getKey(), target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
public String getPathName() {
|
||||
return path != null ? path.toString() : filename;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
interface Visitor {
|
||||
void visit(Location loc);
|
||||
void visit(Location origin, Location target);
|
||||
}
|
||||
}
|
||||
|
@ -190,6 +190,11 @@ class JdepsTask {
|
||||
task.options.fullVersion = true;
|
||||
}
|
||||
},
|
||||
new HiddenOption(false, "-showlabel") {
|
||||
void process(JdepsTask task, String opt, String arg) {
|
||||
task.options.showLabel = true;
|
||||
}
|
||||
},
|
||||
new HiddenOption(true, "-depth") {
|
||||
void process(JdepsTask task, String opt, String arg) throws BadArgs {
|
||||
try {
|
||||
@ -279,12 +284,21 @@ class JdepsTask {
|
||||
|
||||
private void generateDotFiles(Path dir, Analyzer analyzer) throws IOException {
|
||||
Path summary = dir.resolve("summary.dot");
|
||||
try (PrintWriter sw = new PrintWriter(Files.newOutputStream(summary));
|
||||
DotFileFormatter formatter = new DotFileFormatter(sw, "summary")) {
|
||||
for (Archive archive : sourceLocations) {
|
||||
analyzer.visitArchiveDependences(archive, formatter);
|
||||
boolean verbose = options.verbose == Analyzer.Type.VERBOSE;
|
||||
DotGraph<?> graph = verbose ? new DotSummaryForPackage()
|
||||
: new DotSummaryForArchive();
|
||||
for (Archive archive : sourceLocations) {
|
||||
analyzer.visitArchiveDependences(archive, graph);
|
||||
if (verbose || options.showLabel) {
|
||||
// traverse detailed dependences to generate package-level
|
||||
// summary or build labels for edges
|
||||
analyzer.visitDependences(archive, graph);
|
||||
}
|
||||
}
|
||||
try (PrintWriter sw = new PrintWriter(Files.newOutputStream(summary))) {
|
||||
graph.writeTo(sw);
|
||||
}
|
||||
// output individual .dot file for each archive
|
||||
if (options.verbose != Analyzer.Type.SUMMARY) {
|
||||
for (Archive archive : sourceLocations) {
|
||||
if (analyzer.hasDependences(archive)) {
|
||||
@ -365,17 +379,16 @@ class JdepsTask {
|
||||
}
|
||||
}
|
||||
}
|
||||
sourceLocations.addAll(archives);
|
||||
|
||||
List<Archive> classpaths = new ArrayList<>(); // for class file lookup
|
||||
classpaths.addAll(getClassPathArchives(options.classpath));
|
||||
if (options.includePattern != null) {
|
||||
archives.addAll(getClassPathArchives(options.classpath));
|
||||
} else {
|
||||
classpaths.addAll(getClassPathArchives(options.classpath));
|
||||
archives.addAll(classpaths);
|
||||
}
|
||||
classpaths.addAll(PlatformClassPath.getArchives());
|
||||
|
||||
// add all archives to the source locations for reporting
|
||||
sourceLocations.addAll(archives);
|
||||
// add all classpath archives to the source locations for reporting
|
||||
sourceLocations.addAll(classpaths);
|
||||
|
||||
// Work queue of names of classfiles to be searched.
|
||||
@ -557,6 +570,7 @@ class JdepsTask {
|
||||
boolean showSummary;
|
||||
boolean wildcard;
|
||||
boolean apiOnly;
|
||||
boolean showLabel;
|
||||
String dotOutputDir;
|
||||
String classpath = "";
|
||||
int depth = 1;
|
||||
@ -627,16 +641,34 @@ class JdepsTask {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the given archive is JDK archive and non-null Profile,
|
||||
* this method returns the profile name only if -profile option is specified;
|
||||
* a null profile indicates it accesses a private JDK API and this method
|
||||
* will return "JDK internal API".
|
||||
*
|
||||
* For non-JDK archives, this method returns the file name of the archive.
|
||||
*/
|
||||
private String getProfileArchiveInfo(Archive source, Profile profile) {
|
||||
if (options.showProfile && profile != null)
|
||||
return profile.toString();
|
||||
|
||||
if (source instanceof JDKArchive) {
|
||||
return profile == null ? "JDK internal API (" + source.getFileName() + ")" : "";
|
||||
}
|
||||
return source.getFileName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file name of the archive for non-JRE class or
|
||||
* internal JRE classes. It returns empty string for SE API.
|
||||
* Returns the profile name or "JDK internal API" for JDK archive;
|
||||
* otherwise empty string.
|
||||
*/
|
||||
private static String getArchiveName(Archive source, String profile) {
|
||||
String name = source.getFileName();
|
||||
if (source instanceof JDKArchive)
|
||||
return profile.isEmpty() ? "JDK internal API (" + name + ")" : "";
|
||||
return name;
|
||||
private String profileName(Archive archive, Profile profile) {
|
||||
if (archive instanceof JDKArchive) {
|
||||
return Objects.toString(profile, "JDK internal API");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
class RawOutputFormatter implements Analyzer.Visitor {
|
||||
@ -648,21 +680,18 @@ class JdepsTask {
|
||||
private String pkg = "";
|
||||
@Override
|
||||
public void visitDependence(String origin, Archive source,
|
||||
String target, Archive archive, String profile) {
|
||||
String target, Archive archive, Profile profile) {
|
||||
if (!origin.equals(pkg)) {
|
||||
pkg = origin;
|
||||
writer.format(" %s (%s)%n", origin, source.getFileName());
|
||||
}
|
||||
String name = (options.showProfile && !profile.isEmpty())
|
||||
? profile
|
||||
: getArchiveName(archive, profile);
|
||||
writer.format(" -> %-50s %s%n", target, name);
|
||||
writer.format(" -> %-50s %s%n", target, getProfileArchiveInfo(archive, profile));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitArchiveDependence(Archive origin, Archive target, String profile) {
|
||||
writer.format("%s -> %s", origin, target);
|
||||
if (options.showProfile && !profile.isEmpty()) {
|
||||
public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
|
||||
writer.format("%s -> %s", origin.getPathName(), target.getPathName());
|
||||
if (options.showProfile && profile != null) {
|
||||
writer.format(" (%s)%n", profile);
|
||||
} else {
|
||||
writer.format("%n");
|
||||
@ -670,19 +699,14 @@ class JdepsTask {
|
||||
}
|
||||
}
|
||||
|
||||
class DotFileFormatter implements Analyzer.Visitor, AutoCloseable {
|
||||
class DotFileFormatter extends DotGraph<String> implements AutoCloseable {
|
||||
private final PrintWriter writer;
|
||||
private final String name;
|
||||
DotFileFormatter(PrintWriter writer, String name) {
|
||||
this.writer = writer;
|
||||
this.name = name;
|
||||
writer.format("digraph \"%s\" {%n", name);
|
||||
}
|
||||
DotFileFormatter(PrintWriter writer, Archive archive) {
|
||||
this.writer = writer;
|
||||
this.name = archive.getFileName();
|
||||
writer.format("digraph \"%s\" {%n", name);
|
||||
writer.format(" // Path: %s%n", archive.toString());
|
||||
writer.format(" // Path: %s%n", archive.getPathName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -690,39 +714,169 @@ class JdepsTask {
|
||||
writer.println("}");
|
||||
}
|
||||
|
||||
private final Set<String> edges = new HashSet<>();
|
||||
private String node = "";
|
||||
@Override
|
||||
public void visitDependence(String origin, Archive source,
|
||||
String target, Archive archive, String profile) {
|
||||
if (!node.equals(origin)) {
|
||||
edges.clear();
|
||||
node = origin;
|
||||
}
|
||||
String target, Archive archive, Profile profile) {
|
||||
// if -P option is specified, package name -> profile will
|
||||
// be shown and filter out multiple same edges.
|
||||
if (!edges.contains(target)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String name = options.showProfile && !profile.isEmpty()
|
||||
? profile
|
||||
: getArchiveName(archive, profile);
|
||||
writer.format(" %-50s -> %s;%n",
|
||||
String.format("\"%s\"", origin),
|
||||
name.isEmpty() ? String.format("\"%s\"", target)
|
||||
: String.format("\"%s (%s)\"", target, name));
|
||||
edges.add(target);
|
||||
String name = getProfileArchiveInfo(archive, profile);
|
||||
writeEdge(writer, new Edge(origin, target, getProfileArchiveInfo(archive, profile)));
|
||||
}
|
||||
@Override
|
||||
public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
class DotSummaryForArchive extends DotGraph<Archive> {
|
||||
@Override
|
||||
public void visitDependence(String origin, Archive source,
|
||||
String target, Archive archive, Profile profile) {
|
||||
Edge e = findEdge(source, archive);
|
||||
assert e != null;
|
||||
// add the dependency to the label if enabled and not compact1
|
||||
if (profile == Profile.COMPACT1) {
|
||||
return;
|
||||
}
|
||||
e.addLabel(origin, target, profileName(archive, profile));
|
||||
}
|
||||
@Override
|
||||
public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
|
||||
// add an edge with the archive's name with no tag
|
||||
// so that there is only one node for each JDK archive
|
||||
// while there may be edges to different profiles
|
||||
Edge e = addEdge(origin, target, "");
|
||||
if (target instanceof JDKArchive) {
|
||||
// add a label to print the profile
|
||||
if (profile == null) {
|
||||
e.addLabel("JDK internal API");
|
||||
} else if (options.showProfile && !options.showLabel) {
|
||||
e.addLabel(profile.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DotSummaryForPackage generates the summary.dot file for verbose mode
|
||||
// (-v or -verbose option) that includes all class dependencies.
|
||||
// The summary.dot file shows package-level dependencies.
|
||||
class DotSummaryForPackage extends DotGraph<String> {
|
||||
private String packageOf(String cn) {
|
||||
int i = cn.lastIndexOf('.');
|
||||
return i > 0 ? cn.substring(0, i) : "<unnamed>";
|
||||
}
|
||||
@Override
|
||||
public void visitArchiveDependence(Archive origin, Archive target, String profile) {
|
||||
String name = options.showProfile && !profile.isEmpty()
|
||||
? profile : "";
|
||||
writer.format(" %-30s -> \"%s\";%n",
|
||||
String.format("\"%s\"", origin.getFileName()),
|
||||
name.isEmpty()
|
||||
? target.getFileName()
|
||||
: String.format("%s (%s)", target.getFileName(), name));
|
||||
public void visitDependence(String origin, Archive source,
|
||||
String target, Archive archive, Profile profile) {
|
||||
// add a package dependency edge
|
||||
String from = packageOf(origin);
|
||||
String to = packageOf(target);
|
||||
Edge e = addEdge(from, to, getProfileArchiveInfo(archive, profile));
|
||||
|
||||
// add the dependency to the label if enabled and not compact1
|
||||
if (!options.showLabel || profile == Profile.COMPACT1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// trim the package name of origin to shorten the label
|
||||
int i = origin.lastIndexOf('.');
|
||||
String n1 = i < 0 ? origin : origin.substring(i+1);
|
||||
e.addLabel(n1, target, profileName(archive, profile));
|
||||
}
|
||||
@Override
|
||||
public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
|
||||
// nop
|
||||
}
|
||||
}
|
||||
abstract class DotGraph<T> implements Analyzer.Visitor {
|
||||
private final Set<Edge> edges = new LinkedHashSet<>();
|
||||
private Edge curEdge;
|
||||
public void writeTo(PrintWriter writer) {
|
||||
writer.format("digraph \"summary\" {%n");
|
||||
for (Edge e: edges) {
|
||||
writeEdge(writer, e);
|
||||
}
|
||||
writer.println("}");
|
||||
}
|
||||
|
||||
void writeEdge(PrintWriter writer, Edge e) {
|
||||
writer.format(" %-50s -> \"%s\"%s;%n",
|
||||
String.format("\"%s\"", e.from.toString()),
|
||||
e.tag.isEmpty() ? e.to
|
||||
: String.format("%s (%s)", e.to, e.tag),
|
||||
getLabel(e));
|
||||
}
|
||||
|
||||
Edge addEdge(T origin, T target, String tag) {
|
||||
Edge e = new Edge(origin, target, tag);
|
||||
if (e.equals(curEdge)) {
|
||||
return curEdge;
|
||||
}
|
||||
|
||||
if (edges.contains(e)) {
|
||||
for (Edge e1 : edges) {
|
||||
if (e.equals(e1)) {
|
||||
curEdge = e1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
edges.add(e);
|
||||
curEdge = e;
|
||||
}
|
||||
return curEdge;
|
||||
}
|
||||
|
||||
Edge findEdge(T origin, T target) {
|
||||
for (Edge e : edges) {
|
||||
if (e.from.equals(origin) && e.to.equals(target)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
String getLabel(Edge e) {
|
||||
String label = e.label.toString();
|
||||
return label.isEmpty() ? "" : String.format("[label=\"%s\",fontsize=9]", label);
|
||||
}
|
||||
|
||||
class Edge {
|
||||
final T from;
|
||||
final T to;
|
||||
final String tag; // optional tag
|
||||
final StringBuilder label = new StringBuilder();
|
||||
Edge(T from, T to, String tag) {
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.tag = tag;
|
||||
}
|
||||
void addLabel(String s) {
|
||||
label.append(s).append("\\n");
|
||||
}
|
||||
void addLabel(String origin, String target, String profile) {
|
||||
label.append(origin).append(" -> ").append(target);
|
||||
if (!profile.isEmpty()) {
|
||||
label.append(" (" + profile + ")");
|
||||
}
|
||||
label.append("\\n");
|
||||
}
|
||||
@Override @SuppressWarnings("unchecked")
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof DotGraph<?>.Edge) {
|
||||
DotGraph<?>.Edge e = (DotGraph<?>.Edge)o;
|
||||
return this.from.equals(e.from) &&
|
||||
this.to.equals(e.to) &&
|
||||
this.tag.equals(e.tag);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 67 * hash + Objects.hashCode(this.from) +
|
||||
Objects.hashCode(this.to) + Objects.hashCode(this.tag);
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,8 +81,12 @@ enum Profile {
|
||||
}
|
||||
|
||||
static class PackageToProfile {
|
||||
static String[] JAVAX_CRYPTO_PKGS = new String[] {
|
||||
"javax.crypto",
|
||||
"javax.crypto.interfaces",
|
||||
"javax.crypto.spec"
|
||||
};
|
||||
static Map<String, Profile> map = initProfiles();
|
||||
|
||||
private static Map<String, Profile> initProfiles() {
|
||||
try {
|
||||
String profilesProps = System.getProperty("jdeps.profiles");
|
||||
@ -103,6 +107,9 @@ enum Profile {
|
||||
findProfile(cf);
|
||||
}
|
||||
}
|
||||
// special case for javax.crypto.* classes that are not
|
||||
// included in ct.sym since they are in jce.jar
|
||||
Collections.addAll(Profile.COMPACT1.packages, JAVAX_CRYPTO_PKGS);
|
||||
}
|
||||
}
|
||||
} catch (IOException | ConstantPoolException e) {
|
||||
|
@ -209,11 +209,11 @@ public interface Processor {
|
||||
* <dl>
|
||||
* <dt><i>SupportedOptionString:</i>
|
||||
* <dd><i>Identifiers</i>
|
||||
* <p>
|
||||
*
|
||||
* <dt><i>Identifiers:</i>
|
||||
* <dd> <i>Identifier</i>
|
||||
* <dd> <i>Identifier</i> {@code .} <i>Identifiers</i>
|
||||
* <p>
|
||||
*
|
||||
* <dt><i>Identifier:</i>
|
||||
* <dd>Syntactic identifier, including keywords and literals
|
||||
* </dl>
|
||||
@ -250,7 +250,7 @@ public interface Processor {
|
||||
* <dt><i>SupportedAnnotationTypeString:</i>
|
||||
* <dd><i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub>
|
||||
* <dd><tt>*</tt>
|
||||
* <p>
|
||||
*
|
||||
* <dt><i>DotStar:</i>
|
||||
* <dd><tt>.</tt> <tt>*</tt>
|
||||
* </dl>
|
||||
|
@ -38,7 +38,30 @@ import java.lang.annotation.*;
|
||||
* com.sun.*} are official parts of the JDK meant to be generally
|
||||
* usable while other portions of {@code com.sun.*} are not. This
|
||||
* annotation type allows those portions to be easily and
|
||||
* programmaticly distinguished.
|
||||
* programmatically distinguished.
|
||||
*
|
||||
* <p>If in one release a type or package is
|
||||
* <code>@Exported(true)</code>, in a subsequent major release such a
|
||||
* type or package can transition to <code>@Exported(false)</code>.
|
||||
*
|
||||
* <p>If a type or package is <code>@Exported(false)</code> in a
|
||||
* release, it may be removed in a subsequent major release.
|
||||
*
|
||||
* <p>If a top-level type has an <code>@Exported</code> annotation,
|
||||
* any nested member types with the top-level type should have an
|
||||
* <code>@Exported</code> annotation with the same value.
|
||||
*
|
||||
* (In exceptional cases, if a nested type is going to be removed
|
||||
* before its enclosing type, the nested type's could be
|
||||
* <code>@Exported(false)</code> while its enclosing type was
|
||||
* <code>@Exported(true)</code>.)
|
||||
*
|
||||
* Likewise, if a package has an <code>@Exported</code> annotation,
|
||||
* top-level types within that package should also have an
|
||||
* <code>@Exported</code> annotation.
|
||||
*
|
||||
* Sometimes a top-level type may have a different
|
||||
* <code>@Exported</code> value than its package.
|
||||
*
|
||||
* @since 1.8
|
||||
*/
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4651598
|
||||
* @bug 4651598 8026567
|
||||
* @summary Javadoc wrongly inserts </DD> tags when using multiple @author tags
|
||||
* @author dkramer
|
||||
* @run main AuthorDD
|
||||
@ -86,12 +86,12 @@ public class AuthorDD
|
||||
|
||||
// Test single @since tag:
|
||||
|
||||
{ "<dt><span class=\"strong\">Since:</span></dt>"+NL+"<dd>JDK 1.0</dd>",
|
||||
{ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>"+NL+"<dd>JDK 1.0</dd>",
|
||||
BUGID + FS + "p1" + FS + "C1.html" },
|
||||
|
||||
// Test multiple @author tags:
|
||||
|
||||
{ "<dt><span class=\"strong\">Author:</span></dt>"+NL+"<dd>Doug Kramer, Jamie, Neal</dd>",
|
||||
{ "<dt><span class=\"simpleTagLabel\">Author:</span></dt>"+NL+"<dd>Doug Kramer, Jamie, Neal</dd>",
|
||||
BUGID + FS + "p1" + FS + "C1.html" },
|
||||
|
||||
};
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4973609 8015249 8025633
|
||||
* @bug 4973609 8015249 8025633 8026567
|
||||
* @summary Make sure that annotation types with 0 members does not have
|
||||
* extra HR tags.
|
||||
* @author jamieh
|
||||
@ -55,7 +55,7 @@ public class TestAnnotationTypes extends JavadocTester {
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<h3>Field Summary</h3>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../" +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../" +
|
||||
"pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" +
|
||||
"</code> </td>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4652655 4857717 8025633
|
||||
* @bug 4652655 4857717 8025633 8026567
|
||||
* @summary This test verifies that class cross references work properly.
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
@ -48,7 +48,7 @@ public class TestClassCrossReferences extends JavadocTester {
|
||||
"<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" " +
|
||||
"title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"},
|
||||
{BUG_ID + FS + "C.html",
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code>toString</code> in class <code>java.lang.Object</code></dd>" + NL +
|
||||
"</dl>"}
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4632553 4973607
|
||||
* @bug 4632553 4973607 8026567
|
||||
* @summary No need to include type name (class, interface, etc.) before
|
||||
* every single type in class tree.
|
||||
* Make sure class tree includes heirarchy for enums and annotation
|
||||
@ -49,12 +49,12 @@ public class TestClassTree extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
|
||||
"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " +
|
||||
"title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a>"},
|
||||
"title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>"},
|
||||
|
||||
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
|
||||
"<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>" + NL +
|
||||
"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " +
|
||||
"title=\"annotation in pkg\"><span class=\"strong\">AnnotationType</span></a> " +
|
||||
"title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> " +
|
||||
"(implements java.lang.annotation.Annotation)</li>" + NL + "</ul>"},
|
||||
|
||||
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
|
||||
@ -63,14 +63,14 @@ public class TestClassTree extends JavadocTester {
|
||||
"<li type=\"circle\">java.lang.Enum<E> (implements java.lang." +
|
||||
"Comparable<T>, java.io.Serializable)" + NL + "<ul>" + NL +
|
||||
"<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " +
|
||||
"title=\"enum in pkg\"><span class=\"strong\">Coin</span></a></li>" + NL +
|
||||
"title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>" + NL +
|
||||
"</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>"
|
||||
},
|
||||
};
|
||||
private static final String[][] NEGATED_TEST = {
|
||||
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
|
||||
"<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " +
|
||||
"title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a></li>"}
|
||||
"title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4904037
|
||||
* @bug 4904037 8026567
|
||||
* @summary The constructor comments should be surrounded by
|
||||
* <dl></dl>. Check for this in the output.
|
||||
* @author jamieh
|
||||
@ -47,7 +47,7 @@ public class TestConstructorIndent extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "C.html", "<div class=\"block\">" +
|
||||
"This is just a simple constructor.</div>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Parameters:</span></dt>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL +
|
||||
"<dd><code>i</code> - a param.</dd>" + NL +"</dl>"
|
||||
}
|
||||
};
|
||||
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @customTag A custom tag.
|
||||
* @unknownTag An unknown tag
|
||||
*/
|
||||
public class TagTestClass {
|
||||
|
||||
public void method(){}
|
||||
}
|
109
langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java
Normal file
109
langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java
Normal file
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 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 8006248
|
||||
* @summary Test custom tag. Verify that an unknown tag generates appropriate warnings.
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
* @build JavadocTester taglets.CustomTag TestCustomTag
|
||||
* @run main TestCustomTag
|
||||
*/
|
||||
|
||||
public class TestCustomTag extends JavadocTester {
|
||||
|
||||
//Test information.
|
||||
private static final String BUG_ID = "8006248";
|
||||
|
||||
//Javadoc arguments.
|
||||
private static final String[] ARGS = new String[] {
|
||||
"-Xdoclint:none", "-d", BUG_ID, "-tagletpath", SRC_DIR,
|
||||
"-taglet", "taglets.CustomTag", "-sourcepath",
|
||||
SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
|
||||
};
|
||||
|
||||
private static final String[] ARGS1 = new String[] {
|
||||
"-d", BUG_ID + "-1", "-tagletpath", SRC_DIR, "-taglet", "taglets.CustomTag",
|
||||
"-sourcepath", SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
|
||||
};
|
||||
private static final String[] ARGS2 = new String[] {
|
||||
"-Xdoclint:none", "-d", BUG_ID + "-2", "-sourcepath",
|
||||
SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
|
||||
};
|
||||
|
||||
private static final String[] ARGS3 = new String[] {
|
||||
"-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, SRC_DIR + FS + "TagTestClass.java"
|
||||
};
|
||||
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST = new String[][] {
|
||||
{WARNING_OUTPUT, "warning - @unknownTag is an unknown tag."
|
||||
}
|
||||
};
|
||||
|
||||
private static final String[][] TEST1 = new String[][] {
|
||||
{ERROR_OUTPUT, "error: unknown tag: unknownTag"
|
||||
}
|
||||
};
|
||||
private static final String[][] TEST2 = new String[][] {
|
||||
{WARNING_OUTPUT, "warning - @customTag is an unknown tag."
|
||||
},
|
||||
{WARNING_OUTPUT, "warning - @unknownTag is an unknown tag."
|
||||
}
|
||||
};
|
||||
|
||||
private static final String[][] TEST3 = new String[][] {
|
||||
{ERROR_OUTPUT, "error: unknown tag: customTag"
|
||||
},
|
||||
{ERROR_OUTPUT, "error: unknown tag: unknownTag"
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The entry point of the test.
|
||||
* @param args the array of command line arguments.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
TestCustomTag tester = new TestCustomTag();
|
||||
run(tester, ARGS, TEST, NO_TEST);
|
||||
run(tester, ARGS1, TEST1, NO_TEST);
|
||||
run(tester, ARGS2, TEST2, NO_TEST);
|
||||
run(tester, ARGS3, TEST3, NO_TEST);
|
||||
tester.printSummary();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public String getBugId() {
|
||||
return BUG_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public String getBugName() {
|
||||
return getClass().getName();
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 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 taglets;
|
||||
|
||||
import com.sun.tools.doclets.internal.toolkit.*;
|
||||
import com.sun.tools.doclets.internal.toolkit.taglets.*;
|
||||
import com.sun.tools.doclets.internal.toolkit.util.*;
|
||||
|
||||
import com.sun.javadoc.*;
|
||||
import java.util.*;
|
||||
|
||||
public class CustomTag extends BaseTaglet {
|
||||
|
||||
public CustomTag() {
|
||||
name = "customTag";
|
||||
}
|
||||
|
||||
public static void register(Map tagletMap) {
|
||||
CustomTag tag = new CustomTag();
|
||||
Taglet t = (Taglet) tagletMap.get(tag.getName());
|
||||
if (t != null) {
|
||||
tagletMap.remove(tag.getName());
|
||||
}
|
||||
tagletMap.put(tag.getName(), tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Content getTagletOutput(Tag tag, TagletWriter writer) {
|
||||
ArrayList inlineTags = new ArrayList();
|
||||
inlineTags.add(new TextTag(tag.holder(), "<dt><span class=\"simpleTagLabel\">Custom Tag:</span></dt><dd>"));
|
||||
inlineTags.addAll(Arrays.asList(tag.inlineTags()));
|
||||
inlineTags.add(new TextTag(tag.holder(), "</dd>"));
|
||||
return writer.commentTagsToOutput(tag,
|
||||
(Tag[]) inlineTags.toArray(new Tag[] {}));
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4927552
|
||||
* @bug 4927552 8026567
|
||||
* @summary <DESC>
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
@ -76,20 +76,20 @@ public class TestDeprecatedDocs extends JavadocTester {
|
||||
{TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},
|
||||
|
||||
{TARGET_FILE2, "<pre>@Deprecated" + NL +
|
||||
"public class <span class=\"strong\">DeprecatedClassByAnnotation</span>" + NL +
|
||||
"public class <span class=\"typeNameLabel\">DeprecatedClassByAnnotation</span>" + NL +
|
||||
"extends java.lang.Object</pre>"},
|
||||
|
||||
{TARGET_FILE2, "<pre>@Deprecated" + NL +
|
||||
"public int field</pre>" + NL +
|
||||
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
|
||||
"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
|
||||
|
||||
{TARGET_FILE2, "<pre>@Deprecated" + NL +
|
||||
"public DeprecatedClassByAnnotation()</pre>" + NL +
|
||||
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
|
||||
"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
|
||||
|
||||
{TARGET_FILE2, "<pre>@Deprecated" + NL +
|
||||
"public void method()</pre>" + NL +
|
||||
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
|
||||
"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
|
||||
};
|
||||
|
||||
private static final String[][] NEGATED_TEST = NO_TEST;
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4857717 8025633
|
||||
* @bug 4857717 8025633 8026567
|
||||
* @summary Test to make sure that externally overriden and implemented methods
|
||||
* are documented properly. The method should still include "implements" or
|
||||
* "overrides" documentation even though the method is external.
|
||||
@ -38,13 +38,13 @@ public class TestExternalOverridenMethod extends JavadocTester {
|
||||
private static final String BUG_ID = "4857717";
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "pkg" + FS + "XReader.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read--\" " +
|
||||
"title=\"class or interface in java.io\">read</a></code> in class <code>" +
|
||||
"<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\" " +
|
||||
"title=\"class or interface in java.io\">FilterReader</a></code></dd>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "XReader.html",
|
||||
"<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt--\" " +
|
||||
"title=\"class or interface in java.io\">readInt</a></code> in interface <code>" +
|
||||
"<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\" " +
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4663254 8016328 8025633
|
||||
* @bug 4663254 8016328 8025633 8026567
|
||||
* @summary Verify that spaces do not appear in hrefs and anchors.
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
@ -80,7 +80,7 @@ public class TestHref extends JavadocTester {
|
||||
|
||||
//Signature does not link to the page itself.
|
||||
{BUG_ID + FS + "pkg" + FS + "C4.html",
|
||||
"public abstract class <span class=\"strong\">C4<E extends C4<E>></span>"
|
||||
"public abstract class <span class=\"typeNameLabel\">C4<E extends C4<E>></span>"
|
||||
},
|
||||
};
|
||||
private static final String[][] NEGATED_TEST =
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6786690 6820360 8025633
|
||||
* @bug 6786690 6820360 8025633 8026567
|
||||
* @summary This test verifies the nesting of definition list tags.
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
@ -43,7 +43,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
|
||||
// for default value.
|
||||
private static final String[][] TEST_ALL = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class " +
|
||||
"<span class=\"strong\">C1</span>" + NL +
|
||||
"<span class=\"typeNameLabel\">C1</span>" + NL +
|
||||
"extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL +
|
||||
"<dt>Default:</dt>" + NL + "<dd>true</dd>" + NL +
|
||||
@ -54,64 +54,64 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
|
||||
// enclosing comments, tags and deprecated information.
|
||||
private static final String[][] TEST_CMNT_DEPR = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL +
|
||||
"<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>JDK1.0</dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:</span></dt>" + NL +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>JDK1.0</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL +
|
||||
"<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>" +
|
||||
"C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
|
||||
"Serialized Form</a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>" + NL +
|
||||
"<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd>" +
|
||||
"<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" +
|
||||
"<a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>"+ NL + "<dt><span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code>title" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>"+ NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>title" +
|
||||
"</code> - the title</dd>" + NL + "<dd><code>test</code> - boolean value" +
|
||||
"</dd>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL +
|
||||
"</dd>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL +
|
||||
"<dd><code>java.lang.IllegalArgumentException</code> - if the " +
|
||||
"<code>owner</code>'s" + NL +
|
||||
" <code>GraphicsConfiguration</code> is not from a screen " +
|
||||
"device</dd>" + NL + "<dd><code>HeadlessException</code></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code>undecorated" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>undecorated" +
|
||||
"</code> - <code>true</code> if no decorations are" + NL +
|
||||
" to be enabled;" + NL + " <code>false</code> " +
|
||||
"if decorations are to be enabled.</dd>" + NL + "<dt><span class=\"strong\">Since:" +
|
||||
"if decorations are to be enabled.</dd>" + NL + "<dt><span class=\"simpleTagLabel\">Since:" +
|
||||
"</span></dt>" + NL + "<dd>1.4</dd>" + NL +
|
||||
"<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd>" +
|
||||
"<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" +
|
||||
"<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()" +
|
||||
"</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL +
|
||||
"<dd><code>java.io.IOException</code></dd>" + NL + "<dt><span class=\"strong\">See Also:" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL +
|
||||
"<dd><code>java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:" +
|
||||
"</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:" +
|
||||
"</span></dt>" + NL + "<dd><code>set</code> - boolean</dd>" + NL + "<dt><span class=\"strong\">" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" +
|
||||
"</span></dt>" + NL + "<dd><code>set</code> - boolean</dd>" + NL + "<dt><span class=\"simpleTagLabel\">" +
|
||||
"Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span>" +
|
||||
{BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" +
|
||||
"</dt>" + NL + "<dd><code>" +
|
||||
"java.io.IOException</code></dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
|
||||
"java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
|
||||
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
" <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
|
||||
"<div class=\"block\">This field indicates whether the C1 is " +
|
||||
"undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
|
||||
"undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
|
||||
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
" <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
|
||||
"<div class=\"block\">Reads the object stream.</div>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
|
||||
"<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:" +
|
||||
"</span></dt>" + NL + "<dd><code><code>" +
|
||||
"IOException</code></code></dd>" + NL +
|
||||
"<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" </div>" + NL +
|
||||
"<div class=\"block\">The name for this class.</div>"}};
|
||||
|
||||
@ -122,55 +122,55 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
|
||||
// and deprecated information.
|
||||
private static final String[][] TEST_NODEPR = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL +
|
||||
"<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>JDK1.0</dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Since:</span>" +
|
||||
"</dt>" + NL + "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span>" +
|
||||
"</dt>" + NL + "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:" +
|
||||
"</span></dt>" + NL + "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
|
||||
"<code>C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
|
||||
"Serialized Form</a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" +
|
||||
"</span></dt>" + NL + "<dd><code>title</code> - the title</dd>" + NL + "<dd><code>" +
|
||||
"test</code> - boolean value</dd>" + NL + "<dt><span class=\"strong\">Throws:" +
|
||||
"test</code> - boolean value</dd>" + NL + "<dt><span class=\"throwsLabel\">Throws:" +
|
||||
"</span></dt>" + NL + "<dd><code>java.lang.IllegalArgumentException" +
|
||||
"</code> - if the <code>owner</code>'s" + NL + " <code>GraphicsConfiguration" +
|
||||
"</code> is not from a screen device</dd>" + NL + "<dd><code>" +
|
||||
"HeadlessException</code></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Parameters:" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" +
|
||||
"</span></dt>" + NL + "<dd><code>undecorated</code> - <code>true</code>" +
|
||||
" if no decorations are" + NL + " to be enabled;" + NL +
|
||||
" <code>false</code> if decorations are to be enabled." +
|
||||
"</dd>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL +
|
||||
"<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#readObject--\">" +
|
||||
"</dd>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL +
|
||||
"<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#readObject--\">" +
|
||||
"<code>readObject()</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span>" +
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" +
|
||||
"</dt>" + NL + "<dd><code>java.io.IOException</code></dd>" + NL + "<dt>" +
|
||||
"<span class=\"strong\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"strong\">Throws:</span>" +
|
||||
{BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" +
|
||||
"</dt>" + NL + "<dd><code>" +
|
||||
"java.io.IOException</code></dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
|
||||
"java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
|
||||
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
" <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
|
||||
"<div class=\"block\">This field indicates whether the C1 is " +
|
||||
"undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
|
||||
"undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
|
||||
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
" <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
|
||||
"<div class=\"block\">Reads the object stream.</div>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Throws:" +
|
||||
"<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:" +
|
||||
"</span></dt>" + NL + "<dd><code><code>" +
|
||||
"IOException</code></code></dd>" + NL +
|
||||
"<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" </div>" + NL + "<div class=\"block\">" +
|
||||
"The name for this class.</div>"}};
|
||||
|
||||
@ -186,12 +186,12 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
|
||||
"title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
|
||||
"APPLICATION_EXCLUDE</pre>" + NL + "</li>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<pre>boolean " +
|
||||
"undecorated</pre>" + NL + "<div class=\"block\"><span class=\"strong\">" +
|
||||
"Deprecated.</span> <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
|
||||
"undecorated</pre>" + NL + "<div class=\"block\"><span class=\"deprecatedLabel\">" +
|
||||
"Deprecated.</span> <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
|
||||
"setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
|
||||
"Deprecated.</span> <span class=\"italic\">As of JDK version" +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" +
|
||||
"Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" +
|
||||
" 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6786028
|
||||
* @bug 6786028 8026567
|
||||
* @summary This test verifys the use of <strong> HTML tag instead of <B> by Javadoc std doclet.
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
@ -38,7 +38,7 @@ public class TestHtmlStrongTag extends JavadocTester {
|
||||
|
||||
private static final String BUG_ID = "6786028";
|
||||
private static final String[][] TEST1 = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<span class=\"strong\">See Also:</span>"}};
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<span class=\"seeLabel\">See Also:</span>"}};
|
||||
private static final String[][] NEGATED_TEST1 = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>Method Summary</STRONG>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<B>"},
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4852280 4517115 4973608 4994589
|
||||
* @bug 4852280 4517115 4973608 4994589 8026567
|
||||
* @summary Perform tests on index.html file.
|
||||
* Also test that index-all.html has the appropriate output.
|
||||
* Test for unnamed package in index.
|
||||
@ -53,27 +53,27 @@ public class TestIndex extends JavadocTester {
|
||||
|
||||
//Test index-all.html
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">C</span></a>" +
|
||||
"<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">C</span></a>" +
|
||||
" - Class in <a href=\"pkg/package-summary.html\">pkg</a>"},
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"<a href=\"pkg/Interface.html\" title=\"interface in pkg\">" +
|
||||
"<span class=\"strong\">Interface</span></a> - Interface in " +
|
||||
"<span class=\"typeNameLink\">Interface</span></a> - Interface in " +
|
||||
"<a href=\"pkg/package-summary.html\">pkg</a>"},
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"<a href=\"pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
|
||||
"<span class=\"strong\">AnnotationType</span></a> - Annotation Type in " +
|
||||
"<span class=\"typeNameLink\">AnnotationType</span></a> - Annotation Type in " +
|
||||
"<a href=\"pkg/package-summary.html\">pkg</a>"},
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"<a href=\"pkg/Coin.html\" title=\"enum in pkg\">" +
|
||||
"<span class=\"strong\">Coin</span></a> - Enum in " +
|
||||
"<span class=\"typeNameLink\">Coin</span></a> - Enum in " +
|
||||
"<a href=\"pkg/package-summary.html\">pkg</a>"},
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"Class in <a href=\"package-summary.html\"><Unnamed></a>"},
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"<dl>" + NL + "<dt><span class=\"strong\"><a href=\"pkg/C.html#Java\">" +
|
||||
"<dl>" + NL + "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#Java\">" +
|
||||
"Java</a></span> - Static variable in class pkg.<a href=\"pkg/C.html\" " +
|
||||
"title=\"class in pkg\">C</a></dt>" + NL + "<dd> </dd>" + NL +
|
||||
"<dt><span class=\"strong\"><a href=\"pkg/C.html#JDK\">JDK</a></span> " +
|
||||
"<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#JDK\">JDK</a></span> " +
|
||||
"- Static variable in class pkg.<a href=\"pkg/C.html\" title=\"class in pkg\">" +
|
||||
"C</a></dt>" + NL + "<dd> </dd>" + NL + "</dl>"},
|
||||
};
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4682448 4947464 5029946 8025633
|
||||
* @bug 4682448 4947464 5029946 8025633 8026567
|
||||
* @summary Verify that the public modifier does not show up in the
|
||||
* documentation for public methods, as recommended by the JLS.
|
||||
* If A implements I and B extends A, B should be in the list of
|
||||
@ -83,7 +83,7 @@ public class TestInterface extends JavadocTester {
|
||||
},
|
||||
//Make sure "Specified By" has substituted type parameters.
|
||||
{BUG_ID + FS + "pkg" + FS + "Child.html",
|
||||
"<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg/Interface.html#method--\">method</a>" +
|
||||
"</code> in interface <code>" +
|
||||
"<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
|
||||
@ -92,7 +92,7 @@ public class TestInterface extends JavadocTester {
|
||||
},
|
||||
//Make sure "Overrides" has substituted type parameters.
|
||||
{BUG_ID + FS + "pkg" + FS + "Child.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg/Parent.html#method--\">method</a>" +
|
||||
"</code> in class <code><a href=\"../pkg/Parent.html\" " +
|
||||
"title=\"class in pkg\">Parent</a><<a href=\"../pkg/Child.html\" " +
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 7112427 8012295 8025633
|
||||
* @bug 7112427 8012295 8025633 8026567
|
||||
* @summary Test of the JavaFX doclet features.
|
||||
* @author jvalenta
|
||||
* @library ../lib/
|
||||
@ -38,32 +38,32 @@ public class TestJavaFX extends JavadocTester {
|
||||
private static final String[][] TEST =
|
||||
new String[][] {
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd><a href=\"C.html#getRate--\"><code>getRate()</code></a>, " + NL +
|
||||
"<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"C.html#getRate--\"><code>getRate()</code></a>, " + NL +
|
||||
"<a href=\"C.html#setRate-double-\"><code>setRate(double)</code></a></dd>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<pre>public final void setRate(double value)</pre>" + NL +
|
||||
"<div class=\"block\">Sets the value of the property rate.</div>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Property description:</span></dt>" },
|
||||
"<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" },
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<pre>public final double getRate()</pre>" + NL +
|
||||
"<div class=\"block\">Gets the value of the property rate.</div>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Property description:</span></dt>" },
|
||||
"<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" },
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#rateProperty\">rate</a></span></code>" + NL +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#rateProperty\">rate</a></span></code>" + NL +
|
||||
"<div class=\"block\">Defines the direction/speed at which the <code>Timeline</code> is expected to"},
|
||||
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<span class=\"strong\">Default value:</span>"},
|
||||
"<span class=\"simpleTagLabel\">Default value:</span>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<span class=\"strong\">Since:</span></dt>" + NL + "<dd>JavaFX 8.0</dd>" },
|
||||
"<span class=\"simpleTagLabel\">Since:</span></dt>" + NL + "<dd>JavaFX 8.0</dd>" },
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<p>Sets the value of the property <code>Property</code>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<p>Gets the value of the property <code>Property</code>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<span class=\"strong\">Property description:</span>"},
|
||||
"<span class=\"simpleTagLabel\">Property description:</span>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"C.html#setTestMethodProperty--\">setTestMethodProperty</a></span>()</code> </td>" },
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#setTestMethodProperty--\">setTestMethodProperty</a></span>()</code> </td>" },
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<h4>isPaused</h4>" + NL +
|
||||
"<pre>public final double isPaused()</pre>" + NL +
|
||||
|
@ -126,7 +126,7 @@ public class Check implements Taglet {
|
||||
* @param tag the tag representation of this custom tag.
|
||||
*/
|
||||
public String toString(Tag tag) {
|
||||
return "<dt><span class=\"strong\">" + TAG_HEADER + ":</span></dt><dd>" + tag.text() +
|
||||
return "<dt><span class=\"simpleTagLabel\">" + TAG_HEADER + ":</span></dt><dd>" + tag.text() +
|
||||
"</dd>\n";
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4720957 5020118
|
||||
* @bug 4720957 5020118 8026567
|
||||
* @summary Test to make sure that -link and -linkoffline link to
|
||||
* right files.
|
||||
* @author jamieh
|
||||
@ -61,7 +61,7 @@ public class TestLinkOption extends JavadocTester {
|
||||
"Object</a> p3)"
|
||||
},
|
||||
{BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
|
||||
"<pre>public abstract class <span class=\"strong\">StringBuilderChild</span>" + NL +
|
||||
"<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>" + NL +
|
||||
"extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
|
||||
"title=\"class or interface in java.lang\">Object</a></pre>"
|
||||
},
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4638588 4635809 6256068 6270645 8025633
|
||||
* @bug 4638588 4635809 6256068 6270645 8025633 8026567
|
||||
* @summary Test to make sure that members are inherited properly in the Javadoc.
|
||||
* Verify that inheritence labels are correct.
|
||||
* @author jamieh
|
||||
@ -72,7 +72,7 @@ public class TestMemberInheritence extends JavadocTester {
|
||||
|
||||
// Test overriding/implementing methods with generic parameters.
|
||||
{BUG_ID + FS + "pkg" + FS + "BaseClass.html",
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">" +
|
||||
"getAnnotation</a></code> in interface <code>" +
|
||||
"<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4951228 6290760 8025633
|
||||
* @bug 4951228 6290760 8025633 8026567
|
||||
* @summary Test the case where the overriden method returns a different
|
||||
* type than the method in the child class. Make sure the
|
||||
* documentation is inherited but the return type isn't.
|
||||
@ -49,7 +49,7 @@ public class TestMemberSummary extends JavadocTester {
|
||||
// Check return type in member summary.
|
||||
{BUG_ID + FS + "pkg" + FS + "PublicChild.html",
|
||||
"<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>" + NL +
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" +
|
||||
"returnTypeTest</a></span>()</code>"
|
||||
},
|
||||
// Check return type in member detail.
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4131628 4664607 7025314 8023700 7198273 8025633
|
||||
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567
|
||||
* @summary Make sure the Next/Prev Class links iterate through all types.
|
||||
* Make sure the navagation is 2 columns, not 3.
|
||||
* @author jamieh
|
||||
@ -46,17 +46,17 @@ public class TestNavigation extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "pkg" + FS + "A.html", "<li>Prev Class</li>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "A.html",
|
||||
"<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Next Class</span></a>"},
|
||||
"<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "C.html",
|
||||
"<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"strong\">Prev Class</span></a>"},
|
||||
"<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "C.html",
|
||||
"<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Next Class</span></a>"},
|
||||
"<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "E.html",
|
||||
"<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Prev Class</span></a>"},
|
||||
"<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "E.html",
|
||||
"<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"strong\">Next Class</span></a>"},
|
||||
"<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "I.html",
|
||||
"<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Prev Class</span></a>"},
|
||||
"<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "I.html", "<li>Next Class</li>"},
|
||||
// Test for 4664607
|
||||
{BUG_ID + FS + "pkg" + FS + "I.html",
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633
|
||||
* @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633 8026567
|
||||
* @summary Run Javadoc on a set of source files that demonstrate new
|
||||
* language features. Check the output to ensure that the new
|
||||
* language features are properly documented.
|
||||
@ -53,7 +53,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
{BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"},
|
||||
//Make sure enum signature is correct.
|
||||
{BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum " +
|
||||
"<span class=\"strong\">Coin</span>" + NL +
|
||||
"<span class=\"typeNameLabel\">Coin</span>" + NL +
|
||||
"extends java.lang.Enum<<a href=\"../pkg/Coin.html\" " +
|
||||
"title=\"enum in pkg\">Coin</a>></pre>"
|
||||
},
|
||||
@ -62,7 +62,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"</span><span class=\"tabEnd\"> </span></caption>"},
|
||||
//Detail for enum constant
|
||||
{BUG_ID + FS + "pkg" + FS + "Coin.html",
|
||||
"<span class=\"strong\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"},
|
||||
"<span class=\"memberNameLink\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"},
|
||||
//Automatically insert documentation for values() and valueOf().
|
||||
{BUG_ID + FS + "pkg" + FS + "Coin.html",
|
||||
"Returns an array containing the constants of this enum type,"},
|
||||
@ -80,11 +80,11 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"Class TypeParameters<E></h2>"},
|
||||
//Check class type parameters section.
|
||||
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
|
||||
"<dt><span class=\"strong\">Type Parameters:</span></dt>" + NL + "<dd><code>E</code> - " +
|
||||
"<dt><span class=\"paramLabel\">Type Parameters:</span></dt>" + NL + "<dd><code>E</code> - " +
|
||||
"the type parameter for this class."},
|
||||
//Type parameters in @see/@link
|
||||
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd>" +
|
||||
"<dl>" + NL + "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" +
|
||||
"<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
|
||||
"<code>TypeParameters</code></a></dd>" + NL + "</dl>"},
|
||||
//Method that uses class type parameter.
|
||||
@ -93,7 +93,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"parameter in TypeParameters\">E</a> param)"},
|
||||
//Method type parameter section.
|
||||
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
|
||||
"<span class=\"strong\">Type Parameters:</span></dt>" + NL + "<dd><code>T</code> - This is the first " +
|
||||
"<span class=\"paramLabel\">Type Parameters:</span></dt>" + NL + "<dd><code>T</code> - This is the first " +
|
||||
"type parameter.</dd>" + NL + "<dd><code>V</code> - This is the second type " +
|
||||
"parameter."},
|
||||
//Signature of method with type parameters
|
||||
@ -118,7 +118,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
|
||||
//Signature of subclass that has type parameters.
|
||||
{BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
|
||||
"<pre>public class <span class=\"strong\">TypeParameterSubClass<T extends " +
|
||||
"<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass<T extends " +
|
||||
"java.lang.String></span>" + NL + "extends " +
|
||||
"<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" +
|
||||
"TypeParameterSuperClass</a><T></pre>"},
|
||||
@ -168,7 +168,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"Annotation Type AnnotationType</h2>"},
|
||||
//Make sure the signature is correct.
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
"public @interface <span class=\"strong\">AnnotationType</span>"},
|
||||
"public @interface <span class=\"memberNameLabel\">AnnotationType</span>"},
|
||||
//Make sure member summary headings are correct.
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
"<h3>Required Element Summary</h3>"},
|
||||
@ -198,7 +198,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" +
|
||||
"=\"Class Annotation\"," + NL +
|
||||
" <a href=\"../pkg/AnnotationType.html#required--\">" +
|
||||
"required</a>=1994)" + NL + "public class <span class=\"strong\">" +
|
||||
"required</a>=1994)" + NL + "public class <span class=\"typeNameLabel\">" +
|
||||
"AnnotationTypeUsage</span>" + NL + "extends java.lang.Object</pre>"},
|
||||
|
||||
//FIELD
|
||||
@ -299,7 +299,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
{BUG_ID + FS + "pkg1" + FS + "B.html",
|
||||
"<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "B.html",
|
||||
"public interface <span class=\"strong\">B</span></pre>"},
|
||||
"public interface <span class=\"typeNameLabel\">B</span></pre>"},
|
||||
|
||||
|
||||
//==============================================================
|
||||
@ -320,7 +320,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"Foo</a></span><span class=\"tabEnd\"> </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
|
||||
"title=\"class in pkg2\">ClassUseTest1</a><T extends " +
|
||||
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
|
||||
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
|
||||
@ -333,8 +333,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"pkg2\">Foo</a></span><span class=\"tabEnd\"> </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
|
||||
"<td class=\"colLast\"><span class=\"strong\">ClassUseTest1." +
|
||||
"</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
|
||||
"<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest1." +
|
||||
"</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
|
||||
"ClassUseTest1.html#method-T-\">method</a></span>" +
|
||||
"(T t)</code> </td>"
|
||||
},
|
||||
@ -372,7 +372,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"</span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " +
|
||||
"title=\"class in pkg2\">ClassUseTest1</a><T extends " +
|
||||
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
|
||||
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
|
||||
@ -386,8 +386,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"</span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
|
||||
"<td class=\"colLast\"><span class=\"strong\">" +
|
||||
"ClassUseTest1.</span><code><span class=\"strong\"><a href=\"../../" +
|
||||
"<td class=\"colLast\"><span class=\"typeNameLabel\">" +
|
||||
"ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../" +
|
||||
"pkg2/ClassUseTest1.html#method-T-\">method</a></span>" +
|
||||
"(T t)</code> </td>"
|
||||
},
|
||||
@ -401,7 +401,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
" </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
|
||||
"title=\"class in pkg2\">ClassUseTest2</a><T extends " +
|
||||
"<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
|
||||
"ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
|
||||
@ -415,8 +415,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
" </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
|
||||
"<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
|
||||
"</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
|
||||
"<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." +
|
||||
"</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
|
||||
"ClassUseTest2.html#method-T-\">method</a></span>" +
|
||||
"(T t)</code> </td>"
|
||||
},
|
||||
@ -456,7 +456,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"Foo3</a></span><span class=\"tabEnd\"> </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " +
|
||||
"title=\"class in pkg2\">ClassUseTest2</a><T extends " +
|
||||
"<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
|
||||
"ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
|
||||
@ -470,8 +470,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"</span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
|
||||
"<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
|
||||
"</span><code><span class=\"strong\"><a href=\"../../pkg2/" +
|
||||
"<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." +
|
||||
"</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" +
|
||||
"ClassUseTest2.html#method-T-\">method</a></span>" +
|
||||
"(T t)</code> </td>"
|
||||
},
|
||||
@ -500,7 +500,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
" </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
|
||||
"title=\"class in pkg2\">ClassUseTest3</a><T extends " +
|
||||
"<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
|
||||
"ParamTest2</a><java.util.List<? extends " +
|
||||
@ -515,8 +515,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
" </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
|
||||
"<td class=\"colLast\"><span class=\"strong\">ClassUseTest3" +
|
||||
".</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
|
||||
"<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3" +
|
||||
".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
|
||||
"html#method-T-\">method</a></span>(T t)</code> </td>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
|
||||
@ -538,7 +538,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"</span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
|
||||
"<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " +
|
||||
"title=\"class in pkg2\">ClassUseTest3</a><T extends " +
|
||||
"<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
|
||||
"ParamTest2</a><java.util.List<? extends " +
|
||||
@ -552,8 +552,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"pkg2\">Foo4</a></span><span class=\"tabEnd\"> </span></caption>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
|
||||
"<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
|
||||
"</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
|
||||
"<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." +
|
||||
"</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
|
||||
"html#method-T-\">method</a></span>(T t)</code>" +
|
||||
" </td>"
|
||||
},
|
||||
@ -586,8 +586,8 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
"<th class=\"colLast\" scope=\"col\">Method and Description</th>" + NL +
|
||||
"</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL +
|
||||
"<td class=\"colFirst\"><code>void</code></td>" + NL +
|
||||
"<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
|
||||
"</span><code><span class=\"strong\"><a href=\"../../pkg2/ClassUseTest3." +
|
||||
"<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." +
|
||||
"</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." +
|
||||
"html#method-java.util.Set-\">method</a></span>(java." +
|
||||
"util.Set<<a href=\"../../pkg2/Foo4.html\" title=\"" +
|
||||
"class in pkg2\">Foo4</a>> p)</code> </td>" + NL +
|
||||
@ -663,14 +663,14 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
// TYPE PARAMETER IN INDEX
|
||||
//=================================
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"<span class=\"strong\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
|
||||
"<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
|
||||
"method(Vector<Object>)</a></span>"
|
||||
},
|
||||
//=================================
|
||||
// TYPE PARAMETER IN INDEX
|
||||
//=================================
|
||||
{BUG_ID + FS + "index-all.html",
|
||||
"<span class=\"strong\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
|
||||
"<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" +
|
||||
"method(Vector<Object>)</a></span>"
|
||||
},
|
||||
};
|
||||
@ -679,7 +679,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
// ENUM TESTING
|
||||
//=================================
|
||||
//NO constructor section
|
||||
{BUG_ID + FS + "pkg" + FS + "Coin.html", "<span class=\"strong\">Constructor Summary</span>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "Coin.html", "<h3>Constructor Summary</h3>"},
|
||||
//=================================
|
||||
// TYPE PARAMETER TESTING
|
||||
//=================================
|
||||
@ -698,25 +698,25 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
|
||||
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL +
|
||||
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
|
||||
"public class <span class=\"strong\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"},
|
||||
"public class <span class=\"typeNameLabel\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"},
|
||||
|
||||
//FIELD
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
|
||||
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL +
|
||||
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
|
||||
"public int <span class=\"strong\">field</span>"},
|
||||
"public int <span class=\"memberNameLabel\">field</span>"},
|
||||
|
||||
//CONSTRUCTOR
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
|
||||
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL +
|
||||
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
|
||||
"public <span class=\"strong\">AnnotationTypeUsage</span>()"},
|
||||
"public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()"},
|
||||
|
||||
//METHOD
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
|
||||
"<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL +
|
||||
" <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
|
||||
"public void <span class=\"strong\">method</span>()"},
|
||||
"public void <span class=\"memberNameLabel\">method</span>()"},
|
||||
|
||||
//=================================
|
||||
// Make sure annotation types do not
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4368820 8025633
|
||||
* @bug 4368820 8025633 8026567
|
||||
* @summary Inherited comment should link directly to member, not just
|
||||
* class
|
||||
* @author jamieh
|
||||
@ -46,7 +46,7 @@ public class TestOverridenMethodDocCopy extends JavadocTester {
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<span class=\"strong\">Description copied from class: <code>" +
|
||||
"<span class=\"descfrmTypeLabel\">Description copied from class: <code>" +
|
||||
"<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">" +
|
||||
"BaseClass</a></code></span>"
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4634891
|
||||
* @bug 4634891 8026567
|
||||
* @summary Determine if overriden methods are properly documented when
|
||||
* -protected (default) visibility flag is used.
|
||||
* @author jamieh
|
||||
@ -40,12 +40,12 @@ public class TestOverridenPrivateMethods extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
//The public method should be overriden
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
|
||||
|
||||
//The public method in different package should be overriden
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
|
||||
};
|
||||
|
||||
@ -54,17 +54,17 @@ public class TestOverridenPrivateMethods extends JavadocTester {
|
||||
//The package private method should be overriden since the base and sub class are in the same
|
||||
//package. However, the link should not show up because the package private methods are not documented.
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
|
||||
|
||||
//The private method in should not be overriden
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
|
||||
|
||||
//The private method in different package should not be overriden
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
|
||||
|
||||
//The package private method should not be overriden since the base and sub class are in
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4634891 8025633
|
||||
* @bug 4634891 8025633 8026567
|
||||
* @summary Determine if overriden methods are properly documented when
|
||||
* -protected (default) visibility flag is used.
|
||||
* @author jamieh
|
||||
@ -40,14 +40,14 @@ public class TestOverridenPrivateMethodsWithPackageFlag extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
//The public method should be overriden
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" +
|
||||
"publicMethod</a></code> in class <code>" +
|
||||
"<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
|
||||
|
||||
//The public method in different package should be overriden
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" +
|
||||
"publicMethod</a></code> in class <code>" +
|
||||
"<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
|
||||
@ -55,7 +55,7 @@ public class TestOverridenPrivateMethodsWithPackageFlag extends JavadocTester {
|
||||
//The package private method should be overriden since the base and sub class are in the same
|
||||
//package.
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">" +
|
||||
"packagePrivateMethod</a></code> in class <code>" +
|
||||
"<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"}
|
||||
@ -65,18 +65,18 @@ public class TestOverridenPrivateMethodsWithPackageFlag extends JavadocTester {
|
||||
|
||||
//The private method in should not be overriden
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
|
||||
|
||||
//The private method in different package should not be overriden
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
|
||||
|
||||
//The package private method should not be overriden since the base and sub class are in
|
||||
//different packages.
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"},
|
||||
};
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4634891
|
||||
* @bug 4634891 8026567
|
||||
* @summary Determine if overriden methods are properly documented when
|
||||
* -protected (default) visibility flag is used.
|
||||
* @author jamieh
|
||||
@ -40,18 +40,18 @@ public class TestOverridenPrivateMethodsWithPrivateFlag extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
//The public method should be overriden
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
|
||||
|
||||
//The package private method should be overriden since the base and sub class are in the same
|
||||
//package.
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
|
||||
|
||||
//The public method in different package should be overriden
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
|
||||
};
|
||||
|
||||
@ -59,18 +59,18 @@ public class TestOverridenPrivateMethodsWithPrivateFlag extends JavadocTester {
|
||||
|
||||
//The private method in should not be overriden
|
||||
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
|
||||
|
||||
//The private method in different package should not be overriden
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
|
||||
|
||||
//The package private method should not be overriden since the base and sub class are in
|
||||
//different packages.
|
||||
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6492694
|
||||
* @bug 6492694 8026567
|
||||
* @summary Test package deprecation.
|
||||
* @author bpatel
|
||||
* @library ../lib/
|
||||
@ -49,8 +49,8 @@ public class TestPackageDeprecation extends JavadocTester {
|
||||
//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\"><span class=\"italic\">This package is Deprecated." +
|
||||
"<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>" + NL +
|
||||
"<div class=\"block\"><span class=\"deprecationComment\">This package is Deprecated." +
|
||||
"</span></div>"
|
||||
},
|
||||
{BUG_ID + "-1" + FS + "deprecated-list.html",
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4802275 4967243
|
||||
* @bug 4802275 4967243 8026567
|
||||
* @summary Make sure param tags are still printed even though they do not
|
||||
* match up with a real parameters.
|
||||
* Make sure inheritDoc cannot be used in an invalid param tag.
|
||||
@ -48,12 +48,12 @@ public class TestParamTaglet extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
//Regular param tags.
|
||||
{BUG_ID + FS + "pkg" + FS + "C.html",
|
||||
"<span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code>param1</code> - testing 1 2 3.</dd>" +
|
||||
"<span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>param1</code> - testing 1 2 3.</dd>" +
|
||||
NL + "<dd><code>param2</code> - testing 1 2 3."
|
||||
},
|
||||
//Param tags that don't match with any real parameters.
|
||||
{BUG_ID + FS + "pkg" + FS + "C.html",
|
||||
"<span class=\"strong\">Parameters:</span></dt>" + NL + "<dd><code><I>p1</I></code> - testing 1 2 3.</dd>" +
|
||||
"<span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code><I>p1</I></code> - testing 1 2 3.</dd>" +
|
||||
NL + "<dd><code><I>p2</I></code> - testing 1 2 3."
|
||||
},
|
||||
//{@inherit} doc misuse does not cause doclet to throw exception.
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4780441 4874845 4978816 8014017 8016328 8025633
|
||||
* @bug 4780441 4874845 4978816 8014017 8016328 8025633 8026567
|
||||
* @summary Make sure that when the -private flag is not used, members
|
||||
* inherited from package private class are documented in the child.
|
||||
*
|
||||
@ -112,12 +112,12 @@ public class TestPrivateClasses extends JavadocTester {
|
||||
private static final String[][] NEGATED_TEST1 = {
|
||||
// Should not document that a method overrides method from private class.
|
||||
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
|
||||
"<span class=\"strong\">Overrides:</span>"},
|
||||
"<span class=\"overrideSpecifyLabel\">Overrides:</span>"},
|
||||
// Should not document that a method specified by private interface.
|
||||
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
|
||||
"<span class=\"strong\">Specified by:</span>"},
|
||||
"<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
|
||||
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
|
||||
"<span class=\"strong\">Specified by:</span>"},
|
||||
"<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
|
||||
// Should not mention that any documentation was copied.
|
||||
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
|
||||
"Description copied from"},
|
||||
@ -139,7 +139,7 @@ public class TestPrivateClasses extends JavadocTester {
|
||||
//Do not inherit private interface method with generic parameters.
|
||||
//This method has been implemented.
|
||||
{BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
|
||||
"<span class=\"strong\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"},
|
||||
"<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"},
|
||||
};
|
||||
|
||||
// Test output when -private flag is used.
|
||||
@ -176,14 +176,14 @@ public class TestPrivateClasses extends JavadocTester {
|
||||
},
|
||||
// Should document that a method overrides method from private class.
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">" +
|
||||
"methodOverridenFromParent</a></code> in class <code>" +
|
||||
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
|
||||
"PrivateParent</a></code></dd>"},
|
||||
// Should document that a method is specified by private interface.
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
|
||||
"<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" +
|
||||
"methodInterface</a></code> in interface <code>" +
|
||||
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
|
||||
@ -227,11 +227,11 @@ public class TestPrivateClasses extends JavadocTester {
|
||||
//Since private flag is used, we can document that private interface method
|
||||
//with generic parameters has been implemented.
|
||||
{BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
|
||||
"<span class=\"strong\">Description copied from interface: <code>" +
|
||||
"<span class=\"descfrmTypeLabel\">Description copied from interface: <code>" +
|
||||
"<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>"},
|
||||
|
||||
{BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
|
||||
"<dt><span class=\"strong\">Specified by:</span></dt>" + NL +
|
||||
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>" +
|
||||
" in interface <code>" +
|
||||
"<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
|
||||
@ -240,14 +240,14 @@ public class TestPrivateClasses extends JavadocTester {
|
||||
//Make sure when no modifier appear in the class signature, the
|
||||
//signature is displayed correctly without extra space at the beginning.
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
|
||||
"<pre>class <span class=\"strong\">PrivateParent</span>"},
|
||||
"<pre>class <span class=\"typeNameLabel\">PrivateParent</span>"},
|
||||
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
|
||||
"<pre>public class <span class=\"strong\">PublicChild</span>"},
|
||||
"<pre>public class <span class=\"typeNameLabel\">PublicChild</span>"},
|
||||
};
|
||||
private static final String[][] NEGATED_TEST2 = {
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
|
||||
"<pre> class <span class=\"strong\">PrivateParent</span>"},
|
||||
"<pre> class <span class=\"typeNameLabel\">PrivateParent</span>"},
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8006124 8009684 8016921 8023700 8024096 8008164
|
||||
* @bug 8006124 8009684 8016921 8023700 8024096 8008164 8026567 8026770
|
||||
* @summary Test javadoc support for profiles.
|
||||
* @author Bhavesh Patel, Evgeniya Stepanova
|
||||
* @library ../lib/
|
||||
@ -85,6 +85,20 @@ public class TestProfiles extends JavadocTester {
|
||||
"<h3><a href=\"pkg2/compact2-package-summary.html\" "
|
||||
+ "target=\"classFrame\">pkg2</a></h3>"
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "compact2-summary.html",
|
||||
"<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
|
||||
+ "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
|
||||
+ "pkg2</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" "
|
||||
+ "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
|
||||
+ "listing classes, and an explanation\">"
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "compact2-summary.html",
|
||||
"<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
|
||||
+ "<h3><a href=\"pkg4/compact2-package-summary.html\" target=\"classFrame\">"
|
||||
+ "pkg4</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" "
|
||||
+ "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
|
||||
+ "listing classes, and an explanation\">"
|
||||
},
|
||||
// Tests for profileName-package-summary.html listing the summary for a
|
||||
// package in a profile.
|
||||
{PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
|
||||
@ -94,6 +108,12 @@ public class TestProfiles extends JavadocTester {
|
||||
{PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
|
||||
"<div class=\"subTitle\">compact3</div>"
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
|
||||
"<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
|
||||
+ "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
|
||||
+ "cellspacing=\"0\" summary=\"Interface Summary table, listing "
|
||||
+ "interfaces, and an explanation\">"
|
||||
},
|
||||
//Test for "overview-frame.html" showing the "All Profiles" link.
|
||||
{PROFILE_BUG_ID + FS + "overview-frame.html",
|
||||
"<span><a href=\"profile-overview-frame.html\" "
|
||||
@ -122,17 +142,17 @@ public class TestProfiles extends JavadocTester {
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">"
|
||||
+ "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>"
|
||||
+ NL +"<div class=\"block\"><span class=\"italic\">Class1Pkg2. This class is deprecated</span></div>"
|
||||
+ NL +"<div class=\"block\"><span class=\"deprecationComment\">Class1Pkg2. This class is deprecated</span></div>"
|
||||
},
|
||||
//Test deprecated package in profile
|
||||
{PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">"
|
||||
+ "<a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>"
|
||||
+ NL +"<div class=\"block\"><span class=\"italic\">This package is <b>Deprecated</b>."
|
||||
+ NL +"<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>."
|
||||
+ " Use pkg1.</span></div>"
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "pkgDeprecated" + FS + "package-summary.html",
|
||||
"<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>"
|
||||
+ NL + "<div class=\"block\"><span class=\"italic\">This package is <b>Deprecated</b>."
|
||||
"<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>"
|
||||
+ NL + "<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>."
|
||||
+ " Use pkg1.</span></div>"
|
||||
},
|
||||
// need to add teststring when JDK-8015496 will be fixed
|
||||
@ -171,6 +191,21 @@ public class TestProfiles extends JavadocTester {
|
||||
+ "target=\"classFrame\">Anno1Pkg4</a></li>"
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "compact1-summary.html","<li>Use</li>"
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "compact2-summary.html",
|
||||
"<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
|
||||
+ "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
|
||||
+ "pkg2</a></h3>" + NL + "<li class=\"blockList\">" + NL
|
||||
+ "<table class=\"typeSummary\" border=\"0\" "
|
||||
+ "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
|
||||
+ "listing classes, and an explanation\">"
|
||||
},
|
||||
{PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
|
||||
"<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
|
||||
+ "<li class=\"blockList\">" + NL
|
||||
+ "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
|
||||
+ "cellspacing=\"0\" summary=\"Interface Summary table, listing "
|
||||
+ "interfaces, and an explanation\">"
|
||||
}
|
||||
};
|
||||
private static final String[][] PACKAGES_TEST = {
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8006124 8009684 8015663 8015496
|
||||
* @bug 8006124 8009684 8015663 8015496 8026567
|
||||
* @summary Test javadoc options support for profiles.
|
||||
* @author Evgeniya Stepanova
|
||||
* @library ../lib/
|
||||
@ -87,7 +87,7 @@ public class TestProfilesConfiguration extends JavadocTester {
|
||||
{PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html",
|
||||
"<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" +
|
||||
"classFrame\">pkgDeprecated</a></h3>" + NL + "<div class=\"deprecatedContent\">" +
|
||||
"<span class=\"strong\">Deprecated.</span></div>"
|
||||
"<span class=\"deprecatedLabel\">Deprecated.</span></div>"
|
||||
}
|
||||
};
|
||||
private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = {
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6802694 8025633
|
||||
* @bug 6802694 8025633 8026567
|
||||
* @summary This test verifies deprecation info in serialized-form.html.
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
@ -42,29 +42,29 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester {
|
||||
// display the inline comments, tags and deprecation information if any.
|
||||
private static final String[][] TEST_CMNT_DEPR = {
|
||||
{BUG_ID + FS + "serialized-form.html", "<dl>" + NL +
|
||||
"<dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code>" +
|
||||
"java.io.IOException</code></dd>"+ NL + "<dt><span class=\"strong\">See Also:</span>" +
|
||||
"<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + "<dd><code>" +
|
||||
"java.io.IOException</code></dd>"+ NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
|
||||
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
" <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
|
||||
"<div class=\"block\">This field indicates whether the C1 " +
|
||||
"is undecorated.</div>" + NL + " " + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
|
||||
"<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" +
|
||||
"</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
" <span class=\"italic\">As of JDK version 1.5, replaced by" + NL +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL +
|
||||
"<div class=\"block\">Reads the object stream.</div>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code><code>" +
|
||||
"<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + "<dd><code><code>" +
|
||||
"IOException</code></code></dd>" + NL +
|
||||
"<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" +
|
||||
" </div>" + NL + "<div class=\"block\">" +
|
||||
"The name for this class.</div>"}};
|
||||
|
||||
@ -73,12 +73,12 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester {
|
||||
// information if any.
|
||||
private static final String[][] TEST_NOCMNT = {
|
||||
{BUG_ID + FS + "serialized-form.html", "<pre>boolean undecorated</pre>" + NL +
|
||||
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> <span class=\"italic\">" +
|
||||
"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> <span class=\"deprecationComment\">" +
|
||||
"As of JDK version 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
|
||||
"setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"},
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
|
||||
"Deprecated.</span> <span class=\"italic\">As of JDK version" +
|
||||
{BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" +
|
||||
"Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" +
|
||||
" 1.5, replaced by" + NL +
|
||||
" <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
|
||||
"<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4695326 4750173 4920381
|
||||
* @bug 4695326 4750173 4920381 8026567
|
||||
* @summary Test the declarartion of simple tags using -tag. Verify that
|
||||
* "-tag name" is a shortcut for "-tag name:a:Name:". Also verity that
|
||||
* you can escape the ":" character with a back slash so that it is not
|
||||
@ -42,13 +42,13 @@ public class TestSimpleTag extends JavadocTester {
|
||||
private static final String[][] TEST =
|
||||
new String[][] {
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<span class=\"strong\">Todo:</span>"},
|
||||
"<span class=\"simpleTagLabel\">Todo:</span>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<span class=\"strong\">EJB Beans:</span>"},
|
||||
"<span class=\"simpleTagLabel\">EJB Beans:</span>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<span class=\"strong\">Regular Tag:</span>"},
|
||||
"<span class=\"simpleTagLabel\">Regular Tag:</span>"},
|
||||
{"./" + BUG_ID + "/C.html",
|
||||
"<span class=\"strong\">Back-Slash-Tag:</span>"},
|
||||
"<span class=\"simpleTagLabel\">Back-Slash-Tag:</span>"},
|
||||
};
|
||||
|
||||
private static final String[] ARGS = new String[] {
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8008768
|
||||
* @bug 8008768 8026567
|
||||
* @summary Using {@inheritDoc} in simple tag defined via -tag fails
|
||||
* @library ../lib/
|
||||
* @build JavadocTester TestSimpleTagInherit
|
||||
@ -46,10 +46,10 @@ public class TestSimpleTagInherit extends JavadocTester {
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST = {
|
||||
{ BUG_ID + FS + "p" + FS + "TestClass.html",
|
||||
"<dt><span class=\"strong\"><em>Custom:</em></span></dt>" + NL +
|
||||
"<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>" + NL +
|
||||
"<dd>doc for BaseClass class</dd>" },
|
||||
{ BUG_ID + FS + "p" + FS + "TestClass.html",
|
||||
"<dt><span class=\"strong\"><em>Custom:</em></span></dt>" + NL +
|
||||
"<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>" + NL +
|
||||
"<dd>doc for BaseClass method</dd>" }
|
||||
};
|
||||
private static final String[][] NEGATED_TEST = NO_TEST;
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 7180906
|
||||
* @bug 7180906 8026567
|
||||
* @summary Test to make sure that the since tag works correctly
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
@ -48,11 +48,11 @@ public class TestSinceTag extends JavadocTester {
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "C1.html",
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>JDK1.0</dd>"
|
||||
},
|
||||
{BUG_ID + FS + "serialized-form.html",
|
||||
"<dl>" + NL + "<dt><span class=\"strong\">Since:</span></dt>" + NL +
|
||||
"<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL +
|
||||
"<dd>1.4</dd>"
|
||||
}
|
||||
};
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8026370
|
||||
* @bug 8026370 8026567
|
||||
* @summary This test checks the generated tag output.
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
@ -38,15 +38,15 @@ public class TestTagOutput extends JavadocTester {
|
||||
private static final String BUG_ID = "8026370";
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html",
|
||||
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
|
||||
"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},
|
||||
{BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html",
|
||||
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> " +
|
||||
"<span class=\"italic\">Do not use this.</span></div>"}};
|
||||
"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> " +
|
||||
"<span class=\"deprecationComment\">Do not use this.</span></div>"}};
|
||||
|
||||
private static final String[][] NEGATED_TEST = {
|
||||
{BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html",
|
||||
"<div class=\"block\"><span class=\"strong\">Deprecated." +
|
||||
"</span> <span class=\"italic\"></span></div>"}};
|
||||
"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated." +
|
||||
"</span> <span class=\"deprecationComment\"></span></div>"}};
|
||||
|
||||
private static final String[] ARGS =
|
||||
new String[] {
|
||||
|
@ -55,7 +55,7 @@ public class TestTaglets extends JavadocTester {
|
||||
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST_4654308 = new String[][] {
|
||||
{"4654308" + FS + "C.html", "<span class=\"strong\">Foo:</span></dt>" +
|
||||
{"4654308" + FS + "C.html", "<span class=\"simpleTagLabel\">Foo:</span></dt>" +
|
||||
"<dd>my only method is <a href=\"C.html#method--\"><code>here" +
|
||||
"</code></a></dd></dl>"}
|
||||
};
|
||||
|
@ -50,7 +50,7 @@ public class Foo extends BaseTaglet {
|
||||
*/
|
||||
public Content getTagletOutput(Tag tag, TagletWriter writer) {
|
||||
ArrayList inlineTags = new ArrayList();
|
||||
inlineTags.add(new TextTag(tag.holder(), "<dt><span class=\"strong\">Foo:</span></dt><dd>"));
|
||||
inlineTags.add(new TextTag(tag.holder(), "<dt><span class=\"simpleTagLabel\">Foo:</span></dt><dd>"));
|
||||
inlineTags.addAll(Arrays.asList(tag.inlineTags()));
|
||||
inlineTags.add(new TextTag(tag.holder(), "</dd>"));
|
||||
return writer.commentTagsToOutput(tag,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 4530727
|
||||
* @bug 4530727 8026567
|
||||
* @summary When an exception is declared in the method signature but
|
||||
* not documented with a throws tag, we generate a link to it in the
|
||||
* throws section. Make sure that the link is below a Throws heading.
|
||||
@ -38,7 +38,7 @@ public class TestThrowsHead extends JavadocTester {
|
||||
|
||||
private static final String BUG_ID = "4530727";
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "C.html", "<dt><span class=\"strong\">Throws:</span>"}
|
||||
{BUG_ID + FS + "C.html", "<dt><span class=\"throwsLabel\">Throws:</span>"}
|
||||
};
|
||||
private static final String[][] NEGATED_TEST = NO_TEST;
|
||||
private static final String[] ARGS = new String[] {
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8005091 8009686 8025633
|
||||
* @bug 8005091 8009686 8025633 8026567
|
||||
* @summary Make sure that type annotations are displayed correctly
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
@ -74,12 +74,12 @@ public class TestTypeAnnotations extends JavadocTester {
|
||||
|
||||
// Test for type annotations on Class Parameters (ClassParameters.java).
|
||||
{BUG_ID + FS + "typeannos" + FS + "ExtendsBound.html",
|
||||
"class <span class=\"strong\">ExtendsBound<K extends <a " +
|
||||
"class <span class=\"typeNameLabel\">ExtendsBound<K extends <a " +
|
||||
"href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
|
||||
"typeannos\">@ClassParamA</a> java.lang.String></span>"
|
||||
},
|
||||
{BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
|
||||
"<pre>class <span class=\"strong\">ExtendsGeneric<K extends " +
|
||||
"<pre>class <span class=\"typeNameLabel\">ExtendsGeneric<K extends " +
|
||||
"<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
|
||||
"typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
|
||||
"title=\"class in typeannos\">Unannotated</a><<a href=\"" +
|
||||
@ -87,24 +87,24 @@ public class TestTypeAnnotations extends JavadocTester {
|
||||
"@ClassParamB</a> java.lang.String>></span>"
|
||||
},
|
||||
{BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
|
||||
"<pre>class <span class=\"strong\">TwoBounds<K extends <a href=\"" +
|
||||
"<pre>class <span class=\"typeNameLabel\">TwoBounds<K extends <a href=\"" +
|
||||
"../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
|
||||
"@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" +
|
||||
"ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" +
|
||||
"</a> java.lang.String></span>"
|
||||
},
|
||||
{BUG_ID + FS + "typeannos" + FS + "Complex1.html",
|
||||
"class <span class=\"strong\">Complex1<K extends <a href=\"../" +
|
||||
"class <span class=\"typeNameLabel\">Complex1<K extends <a href=\"../" +
|
||||
"typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
|
||||
"@ClassParamA</a> java.lang.String & java.lang.Runnable></span>"
|
||||
},
|
||||
{BUG_ID + FS + "typeannos" + FS + "Complex2.html",
|
||||
"class <span class=\"strong\">Complex2<K extends java.lang." +
|
||||
"class <span class=\"typeNameLabel\">Complex2<K extends java.lang." +
|
||||
"String & <a href=\"../typeannos/ClassParamB.html\" title=\"" +
|
||||
"annotation in typeannos\">@ClassParamB</a> java.lang.Runnable></span>"
|
||||
},
|
||||
{BUG_ID + FS + "typeannos" + FS + "ComplexBoth.html",
|
||||
"class <span class=\"strong\">ComplexBoth<K extends <a href=\"" +
|
||||
"class <span class=\"typeNameLabel\">ComplexBoth<K extends <a href=\"" +
|
||||
"../typeannos/ClassParamA.html\" title=\"annotation in typeannos\"" +
|
||||
">@ClassParamA</a> java.lang.String & <a href=\"../typeannos/" +
|
||||
"ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA" +
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4764045 8004825
|
||||
* @bug 4764045 8004825 8026567
|
||||
* @summary This test ensures that the value tag works in all
|
||||
* use cases. The explainations for each test case are written below.
|
||||
* @author jamieh
|
||||
@ -94,7 +94,7 @@ public class TestValueTag extends JavadocTester {
|
||||
"Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>"},
|
||||
//Test @value tag used with custom tag.
|
||||
{BUG_ID + FS + "pkg1" + FS + "CustomTagUsage.html",
|
||||
"<dt><span class=\"strong\">Todo:</span></dt>" + NL +
|
||||
"<dt><span class=\"simpleTagLabel\">Todo:</span></dt>" + NL +
|
||||
"<dd>the value of this constant is 55.</dd>"},
|
||||
//Test @value errors printed dues to invalid use or when used with
|
||||
//non-constant or with bad references.
|
||||
|
19
langtools/test/tools/doclint/CustomTagTest.java
Normal file
19
langtools/test/tools/doclint/CustomTagTest.java
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8006248
|
||||
* @summary DocLint should report unknown tags
|
||||
* @build DocLintTester
|
||||
* @run main DocLintTester CustomTagTest.java
|
||||
* @run main DocLintTester -XcustomTags: -ref CustomTagTest.out CustomTagTest.java
|
||||
* @run main DocLintTester -XcustomTags:customTag -ref CustomTagTestWithOption.out CustomTagTest.java
|
||||
* @run main DocLintTester -XcustomTags:customTag,anotherCustomTag -ref CustomTagTestWithOption.out CustomTagTest.java
|
||||
* @author bpatel
|
||||
*/
|
||||
|
||||
/**
|
||||
* @customTag Text for a custom tag.
|
||||
* @unknownTag Text for an unknown tag.
|
||||
*/
|
||||
public class CustomTagTest {
|
||||
}
|
||||
|
8
langtools/test/tools/doclint/CustomTagTest.out
Normal file
8
langtools/test/tools/doclint/CustomTagTest.out
Normal file
@ -0,0 +1,8 @@
|
||||
CustomTagTest.java:14: error: unknown tag: customTag
|
||||
* @customTag Text for a custom tag.
|
||||
^
|
||||
CustomTagTest.java:15: error: unknown tag: unknownTag
|
||||
* @unknownTag Text for an unknown tag.
|
||||
^
|
||||
2 errors
|
||||
|
5
langtools/test/tools/doclint/CustomTagTestWithOption.out
Normal file
5
langtools/test/tools/doclint/CustomTagTestWithOption.out
Normal file
@ -0,0 +1,5 @@
|
||||
CustomTagTest.java:15: error: unknown tag: unknownTag
|
||||
* @unknownTag Text for an unknown tag.
|
||||
^
|
||||
1 error
|
||||
|
@ -58,6 +58,8 @@ public class DocLintTester {
|
||||
badArgs = true;
|
||||
} else if (arg.startsWith("-Xmsgs")) {
|
||||
opts.add(arg);
|
||||
} else if (arg.startsWith("-XcustomTags")) {
|
||||
opts.add(arg);
|
||||
} else if (arg.startsWith("-")) {
|
||||
opts.add(arg);
|
||||
if (i < args.length - 1 && !args[i+1].startsWith("-"))
|
||||
|
@ -112,11 +112,6 @@ public class ExtDirTest {
|
||||
}
|
||||
|
||||
void createJars() throws Exception {
|
||||
|
||||
// for i in 1 2 3; do
|
||||
// if test ! -d ext${i}; then mkdir ext${i}; fi
|
||||
// cp ${TESTSRC}${FS}ext${i}${FS}*.jar ext${i}
|
||||
// done
|
||||
sun.tools.jar.Main jarGenerator =
|
||||
new sun.tools.jar.Main(System.out, System.err, "jar");
|
||||
|
||||
@ -155,19 +150,19 @@ public class ExtDirTest {
|
||||
|
||||
void compileWithExtDirs() throws Exception {
|
||||
|
||||
//"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext1 "${TESTSRC}${FS}ExtDirTest_1.java"
|
||||
//javac -extdirs ext1 ExtDirTest_1.java
|
||||
ToolBox.JavaToolArgs params =
|
||||
new ToolBox.JavaToolArgs()
|
||||
.setOptions("-d", ".", "-extdirs", "ext1")
|
||||
.setSources(ExtDirTest_1Src);
|
||||
ToolBox.javac(params);
|
||||
|
||||
//"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext1${PS}ext2 "${TESTSRC}${FS}ExtDirTest_2.java"
|
||||
//javac -extdirs ext1:ext2 ExtDirTest_2.java
|
||||
params.setOptions("-d", ".", "-extdirs", "ext1" + File.pathSeparator + "ext2")
|
||||
.setSources(ExtDirTest_2Src);
|
||||
ToolBox.javac(params);
|
||||
|
||||
//"$javac" ${TESTTOOLVMOPTS} -d . -extdirs ext3 "${TESTSRC}${FS}ExtDirTest_3.java"
|
||||
//javac -extdirs ext3 ExtDirTest_3.java
|
||||
params.setOptions("-d", ".", "-extdirs", "ext3")
|
||||
.setSources(ExtDirTest_3Src);
|
||||
ToolBox.javac(params);
|
||||
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user