Skip to content

Commit

Permalink
Use String#isEmpty().
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed May 15, 2022
1 parent f296a1d commit e9cfa9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -452,7 +452,7 @@ private void createNodeBuilders(final BufferedReader in, final ImmutableNode.Bui
key = line;
}
key = key.trim();
if (key.length() < 1) {
if (key.isEmpty()) {
// use space for properties with no key
key = " ";
}
Expand Down Expand Up @@ -734,7 +734,7 @@ protected boolean isCommentLine(final String line) {
return false;
}
// blank lines are also treated as comment lines
return line.length() < 1 || getCommentLeadingCharsUsedInInput().indexOf(line.charAt(0)) >= 0;
return line.isEmpty() || getCommentLeadingCharsUsedInInput().indexOf(line.charAt(0)) >= 0;
}

/**
Expand Down
Expand Up @@ -1107,7 +1107,7 @@ public static String getIncludeOptional() {
static boolean isCommentLine(final String line) {
final String s = line.trim();
// blank lines are also treated as comment lines
return s.length() < 1 || COMMENT_CHARS.indexOf(s.charAt(0)) >= 0;
return s.isEmpty() || COMMENT_CHARS.indexOf(s.charAt(0)) >= 0;
}

/**
Expand Down

0 comments on commit e9cfa9a

Please sign in to comment.