Skip to content

Commit 5d9b6ac

Browse files
Use Java 11 isBlank (#13523)
* Use Java 11 isBlank * Fix issues using OpenRewrite --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b485901 commit 5d9b6ac

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

jablib/src/main/java/org/jabref/model/strings/StringUtil.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,19 +635,18 @@ public static boolean isNullOrEmpty(String toTest) {
635635
}
636636

637637
public static boolean isBlank(String string) {
638-
return !isNotBlank(string);
638+
return (string == null) || string.isBlank();
639639
}
640640

641641
public static boolean isBlank(Optional<String> string) {
642-
return !isNotBlank(string);
642+
return string.isEmpty() || isBlank(string.get());
643643
}
644644

645645
/**
646646
* Checks if a CharSequence is not empty (""), not null and not whitespace only.
647647
*/
648648
public static boolean isNotBlank(String string) {
649-
// No Guava equivalent existing
650-
return StringUtils.isNotBlank(string);
649+
return !isBlank(string);
651650
}
652651

653652
public static boolean isNotBlank(Optional<String> string) {

0 commit comments

Comments
 (0)