diff --git a/watchdog-agent/src/main/java/io/github/algomaster99/Options.java b/watchdog-agent/src/main/java/io/github/algomaster99/Options.java index 6cbe1ba9..a03da13a 100644 --- a/watchdog-agent/src/main/java/io/github/algomaster99/Options.java +++ b/watchdog-agent/src/main/java/io/github/algomaster99/Options.java @@ -43,7 +43,7 @@ public class Options { private Path externalJars; public Options(String agentArgs) { - String[] args = agentArgs.split(",", -1); + String[] args = agentArgs.split(","); Path sbomPath = null; for (String arg : args) { String[] split = arg.split("="); diff --git a/watchdog-agent/src/main/java/io/github/algomaster99/Terminator.java b/watchdog-agent/src/main/java/io/github/algomaster99/Terminator.java index 3f943805..37697952 100644 --- a/watchdog-agent/src/main/java/io/github/algomaster99/Terminator.java +++ b/watchdog-agent/src/main/java/io/github/algomaster99/Terminator.java @@ -8,7 +8,6 @@ import java.security.NoSuchAlgorithmException; import java.security.ProtectionDomain; import java.util.List; -import java.util.Map; import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/watchdog-agent/src/test/java/OptionsTest.java b/watchdog-agent/src/test/java/OptionsTest.java index 5d2e1fa4..db463893 100644 --- a/watchdog-agent/src/test/java/OptionsTest.java +++ b/watchdog-agent/src/test/java/OptionsTest.java @@ -52,6 +52,8 @@ void parse_jdk() throws Exception { // generating 2 times the jdk fingerprint should result in the same fingerprint Options options = new Options("skipShutdown=true"); Options options2 = new Options("skipShutdown=true"); + assertThat(options.getJdkFingerprints()).isNotEmpty(); + assertThat(options2.getJdkFingerprints()).isNotEmpty(); assertThat(options.getJdkFingerprints()).isNotEqualTo(options2.getJdkFingerprints()); } }