Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c16b9f5

Browse filesBrowse files
committed
Use PreferencesData.getInteger when applicable
1 parent 66a973a commit c16b9f5
Copy full SHA for c16b9f5

File tree

1 file changed

+2
-6
lines changed
Filter options

1 file changed

+2
-6
lines changed

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

Copy file name to clipboardExpand all lines: arduino-core/src/cc/arduino/utils/network/HttpConnectionManager.java
+2-6Lines changed: 2 additions & 6 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.