Refactor: Remove redundant boxing/unboxing to parse int primitives (#9065)

This commit is contained in:
DeepCrimson 2022-06-12 09:46:59 -07:00 committed by GitHub
parent 95ede50523
commit 3ae5f4979d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 19 additions and 19 deletions

View file

@ -3361,7 +3361,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
String port = getCachedValue(KEY_PROXY_PORT, "");
if (!host.isEmpty() && !port.isEmpty()) {
connection.setProxyHost(host);
connection.setProxyPort(Integer.valueOf(port));
connection.setProxyPort(Integer.parseInt(port));
String username = getCachedValue(KEY_PROXY_USERNAME, "");
connection.setProxyUsername(username);
if (getCachedValue(KEY_PROXY_REMEMBER, "false").equals("true")) {
@ -3620,7 +3620,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
public static int getSelectedAvatar() {
try {
selectedAvatarId = Integer.valueOf(MageFrame.getPreferences().get(KEY_AVATAR, String.valueOf(DEFAULT_AVATAR_ID)));
selectedAvatarId = Integer.parseInt(MageFrame.getPreferences().get(KEY_AVATAR, String.valueOf(DEFAULT_AVATAR_ID)));
} catch (NumberFormatException n) {
selectedAvatarId = DEFAULT_AVATAR_ID;
} finally {