Skip to content

Commit b2264d2

Browse files
committed
Switch type of commandTimeout in TS3Config to int.
1) It prevents overflows. 2) A timeout longer than Integer.MAX_VALUE -> 24 days is nonsensical anyways.
1 parent c3fb371 commit b2264d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/github/theholywaffle/teamspeak3/TS3Config.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class TS3Config {
3939
private String username = null;
4040
private String password = null;
4141
private boolean debugToFile = false;
42-
private long commandTimeout = 4000;
42+
private int commandTimeout = 4000;
4343

4444
public TS3Config setHost(String host) {
4545
this.host = host;
@@ -112,7 +112,7 @@ boolean getDebugToFile() {
112112
* @throws IllegalArgumentException
113113
* if the timeout value is smaller than or equal to {@code 0}
114114
*/
115-
public TS3Config setCommandTimeout(long commandTimeout) {
115+
public TS3Config setCommandTimeout(int commandTimeout) {
116116
if (commandTimeout <= 0) {
117117
throw new IllegalArgumentException("Timeout value must be greater than 0");
118118
}
@@ -121,7 +121,7 @@ public TS3Config setCommandTimeout(long commandTimeout) {
121121
return this;
122122
}
123123

124-
long getCommandTimeout() {
124+
int getCommandTimeout() {
125125
return commandTimeout;
126126
}
127127
}

0 commit comments

Comments
 (0)