Skip to content

Commit c16b9f5

Browse files
committed
Use PreferencesData.getInteger when applicable
1 parent 66a973a commit c16b9f5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arduino-core/src/cc/arduino/utils/network/HttpConnectionManager.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,15 @@ public class HttpConnectionManager {
6565
userAgent = PreferencesData.get("http.user_agent", defaultUserAgent);
6666
int connectTimeoutFromConfig = 5000;
6767
try {
68-
connectTimeoutFromConfig =
69-
Integer.parseInt(
70-
PreferencesData.get("http.connection_timeout_ms", "5000"));
68+
connectTimeoutFromConfig = PreferencesData.getInteger("http.connection_timeout_ms", 5000);
7169
} catch (NumberFormatException e) {
7270
System.err.println("Error parsing http.connection_timeout_ms config: " + e.getMessage());
7371
}
7472
connectTimeout = connectTimeoutFromConfig;
7573
// Set by default 20 max redirect to follow
7674
int maxRedirectNumberConfig = 20;
7775
try {
78-
maxRedirectNumberConfig =
79-
Integer.parseInt(
80-
PreferencesData.get("http.max_redirect_number", "20"));
76+
maxRedirectNumberConfig = PreferencesData.getInteger("http.max_redirect_number", 20);
8177
} catch (NumberFormatException e) {
8278
System.err.println("Error parsing http.max_redirect_number config: " + e.getMessage());
8379
}

0 commit comments

Comments
 (0)