diff --git a/test-frame-common/src/main/java/io/skodjob/testframe/executor/Exec.java b/test-frame-common/src/main/java/io/skodjob/testframe/executor/Exec.java index ccba1d8..a2d05de 100644 --- a/test-frame-common/src/main/java/io/skodjob/testframe/executor/Exec.java +++ b/test-frame-common/src/main/java/io/skodjob/testframe/executor/Exec.java @@ -45,7 +45,7 @@ public class Exec { private static final Pattern ERROR_PATTERN = Pattern.compile("Error from server \\(([a-zA-Z0-9]+)\\):"); private static final Pattern INVALID_PATTERN = Pattern .compile("The ([a-zA-Z0-9]+) \"([a-z0-9.-]+)\" is invalid:"); - private static final Pattern PATH_SPLITTER = Pattern.compile(System.getProperty("path.separator")); + private static final Pattern PATH_SPLITTER = Pattern.compile(File.pathSeparator); private static final int MAXIMUM_EXEC_LOG_CHARACTER_SIZE = 2000; private static final Object LOCK = new Object(); @@ -271,7 +271,7 @@ public static ExecResult exec(String input, List command, Set en */ public int execute(String input, List commands, Set envVars, long timeoutMs) throws IOException, InterruptedException, ExecutionException { - LOGGER.trace("Running command - " + join(" ", commands.toArray(new String[0]))); + LOGGER.trace("Running command - {}", join(" ", commands.toArray(new String[0]))); ProcessBuilder builder = new ProcessBuilder(); builder.command(commands); if (envVars != null) { @@ -432,7 +432,7 @@ public Future read() { while (scanner.hasNextLine()) { data.append(scanner.nextLine()); if (appendLineSeparator) { - data.append(System.getProperty("line.separator")); + data.append(System.lineSeparator()); } } scanner.close(); diff --git a/test-frame-common/src/main/java/io/skodjob/testframe/executor/ExecResult.java b/test-frame-common/src/main/java/io/skodjob/testframe/executor/ExecResult.java index 80635c3..fb5773a 100644 --- a/test-frame-common/src/main/java/io/skodjob/testframe/executor/ExecResult.java +++ b/test-frame-common/src/main/java/io/skodjob/testframe/executor/ExecResult.java @@ -4,6 +4,7 @@ */ package io.skodjob.testframe.executor; +import java.io.Serial; import java.io.Serializable; /** @@ -11,6 +12,7 @@ */ public class ExecResult implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** @@ -84,11 +86,9 @@ public String err() { */ @Override public String toString() { - final StringBuilder sb = new StringBuilder("ExecResult{"); - sb.append("returnCode=").append(returnCode); - sb.append(", stdOut='").append(stdOut).append('\''); - sb.append(", stdErr='").append(stdErr).append('\''); - sb.append('}'); - return sb.toString(); + return "ExecResult{" + "returnCode=" + returnCode + + ", stdOut='" + stdOut + '\'' + + ", stdErr='" + stdErr + '\'' + + '}'; } }