Fully replace .trim() with .strip() [stage]

This commit is contained in:
crschnick
2025-05-21 06:13:36 +00:00
parent 984dda0287
commit f41784f61c
25 changed files with 38 additions and 38 deletions
@@ -511,7 +511,7 @@ public abstract class Dialog {
@Override
protected DialogElement next(String answer) {
if (element.requiresExplicitUserInput()
&& (answer == null || answer.trim().length() == 0)) {
&& (answer == null || answer.strip().length() == 0)) {
return element;
}
@@ -72,7 +72,7 @@ public abstract class QueryConverter<T> {
throw new IllegalArgumentException("Too many colons");
}
return new AbstractMap.SimpleEntry<>(split[0].trim(), split[1].trim());
return new AbstractMap.SimpleEntry<>(split[0].strip(), split[1].strip());
}
@Override
@@ -38,7 +38,7 @@ public class ProcessOutputException extends Exception {
public static ProcessOutputException of(long exitCode, String... messages) {
var combinedError = Arrays.stream(messages)
.filter(s -> s != null && !s.isBlank())
.map(s -> s.trim())
.map(s -> s.strip())
.collect(Collectors.joining("\n\n"))
.replaceAll("\r\n", "\n");
var hasMessage = !combinedError.isBlank();
@@ -40,7 +40,7 @@ public final class FilePath {
if (value.isBlank()) {
throw new IllegalArgumentException();
}
if (!value.equals(value.trim())) {
if (!value.equals(value.strip())) {
throw new IllegalArgumentException();
}
}
@@ -48,7 +48,7 @@ public class StorePath {
throw new IllegalArgumentException("Separator character " + SEPARATOR + " is not allowed in the names");
}
if (Arrays.stream(names).anyMatch(s -> s.trim().length() == 0)) {
if (Arrays.stream(names).anyMatch(s -> s.strip().length() == 0)) {
throw new IllegalArgumentException("Trimmed entry name is empty");
}