8165991: Fix DocTreeFactory newDocCommentTree
8154349: New doclet incorrectly shows entire text body for JavaFX properties in summary section
Reviewed-by: jjg
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeFactory.java Mon Oct 10 11:21:00 2016 -0700
@@ -112,12 +112,11 @@
/**
* Create a new {@code DocCommentTree} object, to represent a complete doc comment.
- * @param firstSentence the first sentence of the doc comment
- * @param body the body of the doc comment following the first sentence
+ * @param fullBody the entire body of the doc comment
* @param tags the block tags in the doc comment
* @return a {@code DocCommentTree} object
*/
- DocCommentTree newDocCommentTree(List<? extends DocTree> firstSentence, List<? extends DocTree> body, List<? extends DocTree> tags);
+ DocCommentTree newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags);
/**
* Create a new {@code DocRootTree} object, to represent an {@code {@docroot} } tag.
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java Mon Oct 10 11:21:00 2016 -0700
@@ -203,11 +203,10 @@
* where the trees are being synthesized by a tool.
*/
@Override @DefinedBy(Api.COMPILER_TREE)
- public DCDocComment newDocCommentTree(List<? extends DocTree> firstSentence, List<? extends DocTree> body, List<? extends DocTree> tags) {
+ public DCDocComment newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags) {
ListBuffer<DCTree> lb = new ListBuffer<>();
- lb.addAll(cast(firstSentence));
- lb.addAll(cast(body));
- List<DCTree> fullBody = lb.toList();
+ lb.addAll(cast(fullBody));
+ List<DCTree> fBody = lb.toList();
// A dummy comment to keep the diagnostics logic happy.
Comment c = new Comment() {
@@ -231,8 +230,8 @@
return false;
}
};
-
- DCDocComment tree = new DCDocComment(c, fullBody, cast(firstSentence), cast(body), cast(tags));
+ Pair<List<DCTree>, List<DCTree>> pair = splitBody(fullBody);
+ DCDocComment tree = new DCDocComment(c, fBody, pair.fst, pair.snd, cast(tags));
return tree;
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Mon Oct 10 11:21:00 2016 -0700
@@ -368,7 +368,7 @@
* @param htmltree the content tree to which the comment will be added.
*/
protected void addComment(Element member, Content htmltree) {
- if (!utils.getBody(member).isEmpty()) {
+ if (!utils.getFullBody(member).isEmpty()) {
writer.addInlineComment(member, htmltree);
}
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Mon Oct 10 11:21:00 2016 -0700
@@ -290,8 +290,8 @@
*/
@Override
public void addAnnotationTypeDescription(Content annotationInfoTree) {
- if(!configuration.nocomment) {
- if (!utils.getBody(annotationType).isEmpty()) {
+ if (!configuration.nocomment) {
+ if (!utils.getFullBody(annotationType).isEmpty()) {
addInlineComment(annotationType, annotationInfoTree);
}
}
@@ -302,7 +302,7 @@
*/
@Override
public void addAnnotationTypeTagInfo(Content annotationInfoTree) {
- if(!configuration.nocomment) {
+ if (!configuration.nocomment) {
addTagsInfo(annotationType, annotationInfoTree);
}
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Mon Oct 10 11:21:00 2016 -0700
@@ -353,7 +353,7 @@
public void addClassDescription(Content classInfoTree) {
if(!configuration.nocomment) {
// generate documentation for the class.
- if (!utils.getBody(typeElement).isEmpty()) {
+ if (!utils.getFullBody(typeElement).isEmpty()) {
addInlineComment(typeElement, classInfoTree);
}
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Mon Oct 10 11:21:00 2016 -0700
@@ -146,7 +146,7 @@
*/
@Override
public void addComments(VariableElement field, Content fieldTree) {
- if (!utils.getBody(field).isEmpty()) {
+ if (!utils.getFullBody(field).isEmpty()) {
writer.addInlineComment(field, fieldTree);
}
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Mon Oct 10 11:21:00 2016 -0700
@@ -1704,7 +1704,7 @@
* @param htmltree the documentation tree to which the inline comments will be added
*/
public void addInlineComment(Element element, Content htmltree) {
- addCommentTags(element, utils.getBody(element), false, false, htmltree);
+ addCommentTags(element, utils.getFullBody(element), false, false, htmltree);
}
/**
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java Mon Oct 10 11:21:00 2016 -0700
@@ -159,7 +159,7 @@
* @param contentTree the tree to which the deprecated info will be added
*/
public void addMemberDescription(VariableElement field, Content contentTree) {
- if (!utils.getBody(field).isEmpty()) {
+ if (!utils.getFullBody(field).isEmpty()) {
writer.addInlineComment(field, contentTree);
}
List<? extends DocTree> tags = utils.getBlockTags(field, DocTree.Kind.SERIAL);
@@ -210,7 +210,7 @@
*/
public boolean shouldPrintOverview(VariableElement field) {
if (!configuration.nocomment) {
- if(!utils.getBody(field).isEmpty() ||
+ if(!utils.getFullBody(field).isEmpty() ||
writer.hasSerializationOverviewTags(field))
return true;
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Mon Oct 10 11:21:00 2016 -0700
@@ -172,7 +172,7 @@
@Override
public void addComments(TypeMirror holderType, ExecutableElement method, Content methodDocTree) {
TypeElement holder = utils.asTypeElement(holderType);
- if (!utils.getBody(method).isEmpty()) {
+ if (!utils.getFullBody(method).isEmpty()) {
if (holder.equals(typeElement) ||
!(utils.isPublic(holder) ||
utils.isLinkable(holder))) {
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Mon Oct 10 11:21:00 2016 -0700
@@ -182,7 +182,7 @@
@Override
protected void addOverviewHeader(Content body) {
addConfigurationTitle(body);
- if (!utils.getBody(configuration.overviewElement).isEmpty()) {
+ if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
subTitleDiv.addStyle(HtmlStyle.subTitle);
addSummaryComment(configuration.overviewElement, subTitleDiv);
@@ -212,7 +212,7 @@
* be added
*/
protected void addOverviewComment(Content htmltree) {
- if (!utils.getBody(configuration.overviewElement).isEmpty()) {
+ if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
htmltree.addContent(getMarkerAnchor(SectionName.OVERVIEW_DESCRIPTION));
addInlineComment(configuration.overviewElement, htmltree);
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Mon Oct 10 11:21:00 2016 -0700
@@ -484,7 +484,7 @@
* {@inheritDoc}
*/
public void addModuleDescription(Content moduleContentTree) {
- if (!utils.getBody(mdle).isEmpty()) {
+ if (!utils.getFullBody(mdle).isEmpty()) {
Content tree = configuration.allowTag(HtmlTag.SECTION) ? HtmlTree.SECTION() : moduleContentTree;
tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION);
tree.addContent(getMarkerAnchor(SectionName.MODULE_DESCRIPTION));
@@ -528,7 +528,7 @@
li.addContent(Contents.SPACE);
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
Content liNav = new HtmlTree(HtmlTag.LI);
- liNav.addContent(!utils.getBody(mdle).isEmpty() && !configuration.nocomment
+ liNav.addContent(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment
? getHyperLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
: contents.navModuleDescription);
addNavGap(liNav);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Mon Oct 10 11:21:00 2016 -0700
@@ -175,7 +175,7 @@
@Override
protected void addOverviewHeader(Content body) {
addConfigurationTitle(body);
- if (!utils.getBody(configuration.overviewElement).isEmpty()) {
+ if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
subTitleDiv.addStyle(HtmlStyle.subTitle);
addSummaryComment(configuration.overviewElement, subTitleDiv);
@@ -205,7 +205,7 @@
* be added
*/
protected void addOverviewComment(Content htmltree) {
- if (!utils.getBody(configuration.overviewElement).isEmpty()) {
+ if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
htmltree.addContent(getMarkerAnchor(SectionName.OVERVIEW_DESCRIPTION));
addInlineComment(configuration.overviewElement, htmltree);
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Mon Oct 10 11:21:00 2016 -0700
@@ -144,7 +144,7 @@
tHeading.addContent(packageHead);
div.addContent(tHeading);
addDeprecationInfo(div);
- if (!utils.getBody(packageElement).isEmpty() && !configuration.nocomment) {
+ if (!utils.getFullBody(packageElement).isEmpty() && !configuration.nocomment) {
HtmlTree docSummaryDiv = new HtmlTree(HtmlTag.DIV);
docSummaryDiv.addStyle(HtmlStyle.docSummary);
addSummaryComment(packageElement, docSummaryDiv);
@@ -258,7 +258,7 @@
*/
@Override
public void addPackageDescription(Content packageContentTree) {
- if (!utils.getBody(packageElement).isEmpty()) {
+ if (!utils.getFullBody(packageElement).isEmpty()) {
packageContentTree.addContent(
getMarkerAnchor(SectionName.PACKAGE_DESCRIPTION));
Content h2Content = new StringContent(
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Mon Oct 10 11:21:00 2016 -0700
@@ -147,7 +147,7 @@
@Override
public void addComments(ExecutableElement property, Content propertyDocTree) {
TypeElement holder = (TypeElement)property.getEnclosingElement();
- if (!utils.getBody(property).isEmpty()) {
+ if (!utils.getFullBody(property).isEmpty()) {
if (holder.equals(typeElement) ||
(!utils.isPublic(holder) || utils.isLinkable(holder))) {
writer.addInlineComment(property, propertyDocTree);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/CommentUtils.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/CommentUtils.java Mon Oct 10 11:21:00 2016 -0700
@@ -108,27 +108,22 @@
Utils utils = config.utils;
String klassName = utils.getSimpleName(utils.getEnclosingTypeElement(e));
- List<DocTree> fs = new ArrayList<>();
- fs.add(treeFactory.newTextTree(config.getText("doclet.enum_values_doc.firstsentence")));
-
- List<DocTree> body = new ArrayList<>();
- body.add(treeFactory.newTextTree(config.getText("doclet.enum_values_doc.body", klassName)));
+ List<DocTree> fullBody = new ArrayList<>();
+ fullBody.add(treeFactory.newTextTree(config.getText("doclet.enum_values_doc.fullbody", klassName)));
List<DocTree> descriptions = new ArrayList<>();
descriptions.add(treeFactory.newTextTree(config.getText("doclet.enum_values_doc.return")));
List<DocTree> tags = new ArrayList<>();
tags.add(treeFactory.newReturnTree(descriptions));
- DocCommentTree docTree = treeFactory.newDocCommentTree(fs, body, tags);
+ DocCommentTree docTree = treeFactory.newDocCommentTree(fullBody, tags);
dcTreesMap.put(e, new DocCommentDuo(null, docTree));
}
public void setEnumValueOfTree(Configuration config, Element e) {
- List<DocTree> fs = new ArrayList<>();
- fs.add(treeFactory.newTextTree(config.getText("doclet.enum_valueof_doc.firstsentence")));
- List<DocTree> body = new ArrayList<>();
- body.add(treeFactory.newTextTree(config.getText("doclet.enum_valueof_doc.body")));
+ List<DocTree> fullBody = new ArrayList<>();
+ fullBody.add(treeFactory.newTextTree(config.getText("doclet.enum_valueof_doc.fullbody")));
List<DocTree> tags = new ArrayList<>();
@@ -156,7 +151,7 @@
ref = treeFactory.newReferenceTree("java.lang.NullPointerException");
tags.add(treeFactory.newThrowsTree(ref, throwsDescs));
- DocCommentTree docTree = treeFactory.newDocCommentTree(fs, body, tags);
+ DocCommentTree docTree = treeFactory.newDocCommentTree(fullBody, tags);
dcTreesMap.put(e, new DocCommentDuo(null, docTree));
}
@@ -190,11 +185,9 @@
return new DocCommentDuo(treePath.getTreePath(), dcTree);
}
- public void setDocCommentTree(Element element, List<DocTree> firstSentence,
- List<DocTree> bodyTags, List<DocTree> blockTags, Utils utils) {
- DocCommentTree docTree = treeFactory.newDocCommentTree(firstSentence,
- bodyTags,
- blockTags);
+ public void setDocCommentTree(Element element, List<DocTree> fullBody,
+ List<DocTree> blockTags, Utils utils) {
+ DocCommentTree docTree = treeFactory.newDocCommentTree(fullBody, blockTags);
dcTreesMap.put(element, new DocCommentDuo(null, docTree));
// There maybe an entry with the original comments usually null,
// therefore remove that entry if it exists, and allow a new one
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java Mon Oct 10 11:21:00 2016 -0700
@@ -386,8 +386,8 @@
CommentUtils cmtutils = configuration.cmtUtils;
final boolean isSetter = isSetter(member);
final boolean isGetter = isGetter(member);
- List<DocTree> firstSentence = new ArrayList<>();
- List<DocTree> bodyTags = new ArrayList<>();
+
+ List<DocTree> fullBody = new ArrayList<>();
List<DocTree> blockTags = new ArrayList<>();
if (isGetter || isSetter) {
//add "[GS]ets the value of the property PROPERTY_NAME."
@@ -395,21 +395,21 @@
String text = MessageFormat.format(
configuration.getText("doclet.PropertySetterWithName"),
utils.propertyName((ExecutableElement)member));
- firstSentence.addAll(cmtutils.makeFirstSentenceTree(text));
+ fullBody.addAll(cmtutils.makeFirstSentenceTree(text));
}
if (isGetter) {
String text = MessageFormat.format(
configuration.getText("doclet.PropertyGetterWithName"),
utils.propertyName((ExecutableElement) member));
- firstSentence.addAll(cmtutils.makeFirstSentenceTree(text));
+ fullBody.addAll(cmtutils.makeFirstSentenceTree(text));
}
List<? extends DocTree> propertyTags = utils.getBlockTags(property, "propertyDescription");
if (propertyTags.isEmpty()) {
- List<? extends DocTree> comment = utils.getBody(property);
+ List<? extends DocTree> comment = utils.getFullBody(property);
blockTags.addAll(cmtutils.makePropertyDescriptionTree(comment));
}
} else {
- firstSentence.addAll(utils.getBody(property));
+ fullBody.addAll(utils.getFullBody(property));
}
// copy certain tags
@@ -452,7 +452,7 @@
blockTags.add(cmtutils.makeSeeTree(sb.toString(), setter));
}
}
- cmtutils.setDocCommentTree(member, firstSentence, bodyTags, blockTags, utils);
+ cmtutils.setDocCommentTree(member, fullBody, blockTags, utils);
}
/**
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java Mon Oct 10 11:21:00 2016 -0700
@@ -210,7 +210,7 @@
public void buildMethodComments(XMLNode node, Content methodDocTree) {
if (!configuration.nocomment) {
ExecutableElement method = currentMethod;
- if (utils.getBody(currentMethod).isEmpty()) {
+ if (utils.getFullBody(currentMethod).isEmpty()) {
DocFinder.Output docs = DocFinder.search(configuration,
new DocFinder.Input(utils, currentMethod));
if (docs.inlineTags != null && !docs.inlineTags.isEmpty())
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Mon Oct 10 11:21:00 2016 -0700
@@ -207,22 +207,21 @@
doclet.0_and_1={0} and {1}
#Documentation for Enums
-doclet.enum_values_doc.firstsentence=\
-Returns an array containing the constants of this enum type, in\n\
-the order they are declared.
-doclet.enum_values_doc.body=\ This method may be used to iterate\n\
+doclet.enum_values_doc.fullbody=\
+ Returns an array containing the constants of this enum type, in\n\
+ the order they are declared. This method may be used to iterate\n\
over the constants as follows:\n\
<pre>\n\
for ({0} c : {0}.values())\n\
System.out.println(c);\n\
</pre>
+
doclet.enum_values_doc.return=\
an array containing the constants of this enum type, in the order they are declared
-doclet.enum_valueof_doc.firstsentence=\
-Returns the enum constant of this type with the specified name.
-doclet.enum_valueof_doc.body=\n\
-The string must match <i>exactly</i> an identifier used to declare an\n\
+doclet.enum_valueof_doc.fullbody=\
+ Returns the enum constant of this type with the specified name.\n\
+ The string must match <i>exactly</i> an identifier used to declare an\n\
enum constant in this type. (Extraneous whitespace characters are \n\
not permitted.)
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java Mon Oct 10 11:21:00 2016 -0700
@@ -221,7 +221,7 @@
List<Taglet> taglets, TagletWriter writer, Content output) {
Utils utils = writer.configuration().utils;
tagletManager.checkTags(utils, element, utils.getBlockTags(element), false);
- tagletManager.checkTags(utils, element, utils.getBody(element), true);
+ tagletManager.checkTags(utils, element, utils.getFullBody(element), true);
for (Taglet taglet : taglets) {
if (utils.isTypeElement(element) && taglet instanceof ParamTaglet) {
//The type parameters are documented in a special section away
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFinder.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFinder.java Mon Oct 10 11:21:00 2016 -0700
@@ -251,7 +251,7 @@
//We want overall documentation.
output.inlineTags = input.isFirstSentence
? utils.getFirstSentenceTrees(input.element)
- : utils.getBody(input.element);
+ : utils.getFullBody(input.element);
output.holder = input.element;
} else {
input.taglet.inherit(input, output);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Mon Oct 10 11:21:00 2016 -0700
@@ -1453,7 +1453,7 @@
public void setEnumDocumentation(TypeElement elem) {
for (Element e : getMethods(elem)) {
ExecutableElement ee = (ExecutableElement)e;
- if (!getBody(e).isEmpty()) // if already set skip it please
+ if (!getFullBody(e).isEmpty()) // ignore if already set
continue;
if (ee.getSimpleName().contentEquals("values") && ee.getParameters().isEmpty()) {
configuration.cmtUtils.setEnumValuesTree(configuration, e);
@@ -2939,12 +2939,18 @@
return dcTree;
}
+ public List<? extends DocTree> getFullBody(Element element) {
+ DocCommentTree docCommentTree = getDocCommentTree(element);
+ return (docCommentTree == null)
+ ? Collections.emptyList()
+ : docCommentTree.getFullBody();
+ }
+
public List<? extends DocTree> getBody(Element element) {
DocCommentTree docCommentTree = getDocCommentTree(element);
- if (docCommentTree == null)
- return Collections.emptyList();
-
- return docCommentTree.getFullBody();
+ return (docCommentTree == null)
+ ? Collections.emptyList()
+ : docCommentTree.getFullBody();
}
public List<? extends DocTree> getDeprecatedTrees(Element element) {
--- a/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Mon Oct 10 11:21:00 2016 -0700
@@ -61,8 +61,14 @@
+ "<div class=\"block\">Gets the value of the property rate.</div>\n"
+ "<dl>\n"
+ "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>",
- "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
- + "<a href=\"../pkg1/C.html#rateProperty\">rate</a></span></code>",
+ "<td class=\"colFirst\"><code><a href=\"../pkg1/C.DoubleProperty.html\" "
+ + "title=\"class in pkg1\">C.DoubleProperty</a></code></td>\n"
+ + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ + "<a href=\"../pkg1/C.html#rateProperty\">rate</a></span></code></th>\n"
+ + "<td class=\"colLast\">\n"
+ + "<div class=\"block\">Defines the direction/speed at which the "
+ + "<code>Timeline</code> is expected to\n"
+ + " be played.</div>\n</td>",
"<span class=\"simpleTagLabel\">Default value:</span>",
"<span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>JavaFX 8.0</dd>",
@@ -72,13 +78,70 @@
"<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ "<a href=\"../pkg1/C.html#setTestMethodProperty--\">"
+ "setTestMethodProperty</a></span>()</code></th>",
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+ + "<a href=\"../pkg1/C.html#pausedProperty\">paused</a></span></code></th>\n"
+ + "<td class=\"colLast\">\n"
+ + "<div class=\"block\">Defines if paused.</div>",
+ "<h4>paused</h4>\n"
+ + "<pre>public final <a href=\"../pkg1/C.BooleanProperty.html\" "
+ + "title=\"class in pkg1\">C.BooleanProperty</a> pausedProperty</pre>\n"
+ + "<div class=\"block\">Defines if paused. The second line.</div>",
+ "<h4>isPaused</h4>\n"
+ + "<pre>public final double isPaused()</pre>\n"
+ + "<div class=\"block\">Gets the value of the property paused.</div>",
+ "<h4>setPaused</h4>\n"
+ + "<pre>public final void setPaused(boolean value)</pre>\n"
+ + "<div class=\"block\">Sets the value of the property paused.</div>\n"
+ + "<dl>\n"
+ + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
+ + "<dd>Defines if paused. The second line.</dd>\n"
+ + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
+ + "<dd>false</dd>",
"<h4>isPaused</h4>\n"
+ "<pre>public final double isPaused()</pre>\n"
- + "<div class=\"block\">Gets the value of the property paused.</div>");
+ + "<div class=\"block\">Gets the value of the property paused.</div>\n"
+ + "<dl>\n"
+ + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
+ + "<dd>Defines if paused. The second line.</dd>\n"
+ + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
+ + "<dd>false</dd>",
+ "<h4>rate</h4>\n"
+ + "<pre>public final <a href=\"../pkg1/C.DoubleProperty.html\" "
+ + "title=\"class in pkg1\">C.DoubleProperty</a> rateProperty</pre>\n"
+ + "<div class=\"block\">Defines the direction/speed at which the "
+ + "<code>Timeline</code> is expected to\n"
+ + " be played. This is the second line.</div>",
+ "<h4>setRate</h4>\n"
+ + "<pre>public final void setRate(double value)</pre>\n"
+ + "<div class=\"block\">Sets the value of the property rate.</div>\n"
+ + "<dl>\n"
+ + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
+ + "<dd>Defines the direction/speed at which the <code>Timeline</code> is expected to\n"
+ + " be played. This is the second line.</dd>\n"
+ + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
+ + "<dd>11</dd>\n"
+ + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ + "<dd>JavaFX 8.0</dd>",
+ "<h4>getRate</h4>\n"
+ + "<pre>public final double getRate()</pre>\n"
+ + "<div class=\"block\">Gets the value of the property rate.</div>\n"
+ + "<dl>\n"
+ + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
+ + "<dd>Defines the direction/speed at which the <code>Timeline</code> is expected to\n"
+ + " be played. This is the second line.</dd>\n"
+ + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
+ + "<dd>11</dd>\n"
+ + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ + "<dd>JavaFX 8.0</dd>",
+ "");
checkOutput("pkg1/C.html", false,
"A()");
+ checkOutput("index-all.html", true,
+ "<div class=\"block\">Gets the value of the property paused.</div>",
+ "<div class=\"block\">Defines if paused.</div>");
+
checkOutput("pkg1/D.html", true,
"<h3>Properties inherited from class pkg1."
+ "<a href=\"../pkg1/C.html\" title=\"class in pkg1\">C</a></h3>\n"
--- a/langtools/test/jdk/javadoc/doclet/testJavaFX/pkg1/C.java Mon Oct 10 06:47:47 2016 -0700
+++ b/langtools/test/jdk/javadoc/doclet/testJavaFX/pkg1/C.java Mon Oct 10 11:21:00 2016 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -52,7 +52,7 @@
/**
* Defines the direction/speed at which the {@code Timeline} is expected to
- * be played.
+ * be played. This is the second line.
* @defaultValue 11
* @since JavaFX 8.0
*/
@@ -71,7 +71,7 @@
public final double isPaused() {}
/**
- * Defines if paused
+ * Defines if paused. The second line.
* @defaultValue false
*/
public final BooleanProperty pausedProperty() {}
@@ -87,7 +87,7 @@
/**
* Defines the direction/speed at which the {@code Timeline} is expected to
- * be played.
+ * be played. This is the second line.
* @defaultValue 11
*/
private DoubleProperty rate;