Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8277536: Use String.blank in jdk.javadoc where applicable #6323

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -895,7 +895,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.
@@ -911,7 +911,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.
@@ -928,7 +928,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.
@@ -944,7 +944,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.
@@ -1406,14 +1406,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;

@@ -1504,7 +1496,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>