Skip to content

Commit 61392ff

Browse files
authored
Eliminate two warnings in use of String.split (#220)
by using the version with two arguments and explicit 'limit' of -1. (see also https://errorprone.info/bugpattern/StringSplitter)
1 parent 495eca6 commit 61392ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/se/uu/it/dtlsfuzzer/components/sul/core/TlsSul.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void pre() {
148148
config.getDefaultServerConnection().setPort(port);
149149
} else {
150150
String realHost = ((TlsSulServerConfig) sulConfig).getHost();
151-
var split = realHost.split(":");
151+
var split = realHost.split(":", -1);
152152
int port = Integer.parseInt(split[1]);
153153
config.getDefaultClientConnection().setPort(port);
154154
}

src/main/java/se/uu/it/dtlsfuzzer/components/sul/core/config/TlsSulServerConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public SulConfig cloneWithThreadId(int threadId) {
4545
clone.processDir = getProcessDir();
4646
// host
4747
String originalHost = this.getHost();
48-
String[] hostParts = originalHost.split(":");
48+
String[] hostParts = originalHost.split(":", -1);
4949
String hostname = hostParts[0];
5050
int originalPort = Integer.parseInt(hostParts[1]);
5151
int newPort = originalPort + threadId;

0 commit comments

Comments
 (0)