Skip to content
Permalink
Browse files
Use String#isEmpty().
  • Loading branch information
garydgregory committed May 15, 2022
1 parent f296a1d commit e9cfa9a50b02b486e1b702ce0521283243a4f17c
Showing 2 changed files with 3 additions and 3 deletions.
@@ -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 = " ";
}
@@ -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;
}

/**
@@ -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;
}

/**

0 comments on commit e9cfa9a

Please sign in to comment.