Minor: Rename StringUtils#isEmpty to #isBlank

- Better fits the naming used by other tools and also the JDK (String#isBlank as of JDK 11)
This commit is contained in:
ljacqu
2022-12-30 08:44:29 +01:00
parent 779e62674e
commit 9fd532d798
20 changed files with 42 additions and 46 deletions
@@ -226,8 +226,8 @@ public class CommandDescription {
*/
public CommandDescription build() {
checkArgument(!Utils.isCollectionEmpty(labels), "Labels may not be empty");
checkArgument(!StringUtils.isEmpty(description), "Description may not be empty");
checkArgument(!StringUtils.isEmpty(detailedDescription), "Detailed description may not be empty");
checkArgument(!StringUtils.isBlank(description), "Description may not be empty");
checkArgument(!StringUtils.isBlank(detailedDescription), "Detailed description may not be empty");
checkArgument(executableCommand != null, "Executable command must be set");
// parents and permissions may be null; arguments may be empty
@@ -131,7 +131,7 @@ public class CommandHandler {
private static List<String> skipEmptyArguments(String[] args) {
List<String> cleanArguments = new ArrayList<>();
for (String argument : args) {
if (!StringUtils.isEmpty(argument)) {
if (!StringUtils.isBlank(argument)) {
cleanArguments.add(argument);
}
}
@@ -89,7 +89,7 @@ class PlayerAuthViewer implements DebugSection {
* or empty string if the string is null or empty
*/
private static String safeSubstring(String str, int length) {
if (StringUtils.isEmpty(str)) {
if (StringUtils.isBlank(str)) {
return "";
} else if (str.length() < length) {
return str.substring(0, str.length() / 2) + "...";