Skip to content

Commit

Permalink
Update StringUtils.java
Browse files Browse the repository at this point in the history
str == null & str.length == 0 > isEmpty()
  • Loading branch information
dukbong authored Sep 20, 2024
1 parent 27a6e31 commit 8fbb004
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,7 @@ public static boolean hasLength(@Nullable String str) {
*/
@Contract("null -> false")
public static boolean hasText(@Nullable CharSequence str) {
if (str == null) {
return false;
}

int strLen = str.length();
if (strLen == 0) {
if (isEmpty(str)) {
return false;
}

Expand Down

0 comments on commit 8fbb004

Please sign in to comment.