8074407: javadoc: using <pre> after @deprecated tag causes warnings

Reviewed-by: jjg, ksrini
This commit is contained in:
Bhavesh Patel 2017-10-03 12:58:49 -07:00
parent 448718c0af
commit feab9efa52
14 changed files with 153 additions and 112 deletions

View file

@ -334,7 +334,6 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
if (!commentTags.isEmpty()) {
div.addContent(Contents.SPACE);
addInlineDeprecatedComment(annotationType, deprs.get(0), div);
}
}

View file

@ -616,7 +616,6 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
DocTree dt = deprs.get(0);
List<? extends DocTree> commentTags = ch.getBody(configuration, dt);
if (!commentTags.isEmpty()) {
div.addContent(Contents.SPACE);
addInlineDeprecatedComment(typeElement, deprs.get(0), div);
}
}

View file

@ -1715,8 +1715,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
Content div;
Content result = commentTagsToContent(null, element, tags, first);
if (depr) {
Content italic = HtmlTree.SPAN(HtmlStyle.deprecationComment, result);
div = HtmlTree.DIV(HtmlStyle.block, italic);
div = HtmlTree.DIV(HtmlStyle.deprecationComment, result);
htmltree.addContent(div);
}
else {

View file

@ -189,9 +189,8 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
if (utils.isDeprecated(member)) {
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(member));
div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
div.addContent(Contents.SPACE);
if (!deprs.isEmpty()) {
addInlineDeprecatedComment(member, deprs.get(0), div);
addSummaryDeprecatedComment(member, deprs.get(0), div);
}
tdSummary.addContent(div);
return;
@ -200,7 +199,6 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
if (te != null && utils.isTypeElement(te) && utils.isDeprecated(te)) {
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(te));
div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
div.addContent(Contents.SPACE);
tdSummary.addContent(div);
}
}

View file

@ -179,7 +179,6 @@ public class TagletWriterImpl extends TagletWriter {
if (utils.isDeprecated(element)) {
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
htmlWriter.getDeprecatedPhrase(element)));
result.addContent(RawHtml.nbsp);
if (!deprs.isEmpty()) {
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
if (!commentTags.isEmpty()) {
@ -191,19 +190,17 @@ public class TagletWriterImpl extends TagletWriter {
if (utils.isDeprecated(element)) {
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
htmlWriter.getDeprecatedPhrase(element)));
result.addContent(RawHtml.nbsp);
if (!deprs.isEmpty()) {
List<? extends DocTree> bodyTags = ch.getBody(configuration, deprs.get(0));
Content body = commentTagsToOutput(null, element, bodyTags, false);
if (!body.isEmpty())
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecationComment, body));
result.addContent(HtmlTree.DIV(HtmlStyle.deprecationComment, body));
}
} else {
Element ee = utils.getEnclosingTypeElement(element);
if (utils.isDeprecated(ee)) {
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
htmlWriter.getDeprecatedPhrase(ee)));
result.addContent(RawHtml.nbsp);
}
}
}

View file

@ -660,7 +660,7 @@ h1.hidden {
display:inline-block;
}
div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase,
div.block div.deprecationComment, div.block div.block span.emphasizedPhrase,
div.block div.block span.interfaceName {
font-style:normal;
}