Skip to content
Permalink
Browse files
8277536: Use String.blank in jdk.javadoc where applicable
Reviewed-by: jjg
  • Loading branch information
turbanoff authored and jonathan-gibbons committed Dec 7, 2021
1 parent 5b81d5e commit bb50b92b804839577cee5092a8a62a98b760f0dc
Showing 2 changed files with 6 additions and 20 deletions.
@@ -896,7 +896,7 @@ public Content getDocLink(HtmlLinkInfo.Kind context, Element element, CharSequen
* Return the link for the given member.
*
* @param context the id of the context where the link will be printed.
* @param typeElement the typeElement that we should link to. This is not
* @param typeElement the typeElement that we should link to. This is
* not necessarily the type containing element since we may be
* inheriting comments.
* @param element the member being linked to.
@@ -912,7 +912,7 @@ public Content getDocLink(HtmlLinkInfo.Kind context, TypeElement typeElement, El
* Return the link for the given member.
*
* @param context the id of the context where the link will be printed.
* @param typeElement the typeElement that we should link to. This is not
* @param typeElement the typeElement that we should link to. This is
* not necessarily the type containing element since we may be
* inheriting comments.
* @param element the member being linked to.
@@ -929,7 +929,7 @@ public Content getDocLink(HtmlLinkInfo.Kind context, TypeElement typeElement, El
* Return the link for the given member.
*
* @param context the id of the context where the link will be printed.
* @param typeElement the typeElement that we should link to. This is not
* @param typeElement the typeElement that we should link to. This is
* not necessarily the type containing element since we may be
* inheriting comments.
* @param element the member being linked to.
@@ -945,7 +945,7 @@ public Content getDocLink(HtmlLinkInfo.Kind context, TypeElement typeElement, El
* Return the link for the given member.
*
* @param context the id of the context where the link will be printed.
* @param typeElement the typeElement that we should link to. This is not
* @param typeElement the typeElement that we should link to. This is
* not necessarily the type containing element since we may be
* inheriting comments.
* @param element the member being linked to.
@@ -1407,14 +1407,6 @@ boolean ignoreNonInlineTag(DocTree dtree) {
return false;
}

boolean isAllWhiteSpace(String body) {
for (int i = 0 ; i < body.length(); i++) {
if (!Character.isWhitespace(body.charAt(i)))
return false;
}
return true;
}

// Notify the next DocTree handler to take necessary action
private boolean commentRemoved = false;

@@ -1505,7 +1497,7 @@ public ContentBuilder add(CharSequence text) {
// Ignore any trailing whitespace OR whitespace after removed html comment
if ((isLastNode || commentRemoved)
&& tag.getKind() == TEXT
&& isAllWhiteSpace(ch.getText(tag)))
&& ch.getText(tag).isBlank())
continue;

// Ignore any leading html comments
@@ -1236,13 +1236,7 @@ void warnIfEmpty(DocTree tree, List<? extends DocTree> list) {
}

boolean hasNonWhitespace(TextTree tree) {
String s = tree.getBody();
for (int i = 0; i < s.length(); i++) {
Character c = s.charAt(i);
if (!Character.isWhitespace(s.charAt(i)))
return true;
}
return false;
return !tree.getBody().isBlank();
}

// </editor-fold>

1 comment on commit bb50b92

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on bb50b92 Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.