mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Refactor: Remove redundant boxing/unboxing to parse int primitives (#9065)
This commit is contained in:
parent
95ede50523
commit
3ae5f4979d
13 changed files with 19 additions and 19 deletions
|
|
@ -1317,7 +1317,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
i++;
|
||||
}
|
||||
if (arg.startsWith(PORT_ARG)) {
|
||||
startPort = Integer.valueOf(args[i + 1]);
|
||||
startPort = Integer.parseInt(args[i + 1]);
|
||||
i++;
|
||||
}
|
||||
if (arg.startsWith(DEBUG_ARG)) {
|
||||
|
|
|
|||
|
|
@ -673,7 +673,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
s.separateCreatures = Boolean.valueOf(m.group(2));
|
||||
}
|
||||
if (m.groupCount() > 2) {
|
||||
s.cardSize = Integer.valueOf(m.group(3));
|
||||
s.cardSize = Integer.parseInt(m.group(3));
|
||||
} else {
|
||||
s.cardSize = 50;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ public class RegisterUserDialog extends MageDialog {
|
|||
}
|
||||
connection = new Connection();
|
||||
connection.setHost(this.txtServer.getText().trim());
|
||||
connection.setPort(Integer.valueOf(this.txtPort.getText().trim()));
|
||||
connection.setPort(Integer.parseInt(this.txtPort.getText().trim()));
|
||||
connection.setUsername(this.txtUserName.getText().trim());
|
||||
connection.setPassword(String.valueOf(this.txtPassword.getPassword()).trim());
|
||||
connection.setEmail(this.txtEmail.getText().trim());
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ public class ResetPasswordDialog extends MageDialog {
|
|||
|
||||
connection = new Connection();
|
||||
connection.setHost(this.txtServer.getText().trim());
|
||||
connection.setPort(Integer.valueOf(this.txtPort.getText().trim()));
|
||||
connection.setPort(Integer.parseInt(this.txtPort.getText().trim()));
|
||||
PreferencesDialog.setProxyInformation(connection);
|
||||
connection.setEmail(this.txtEmail.getText().trim());
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ public class ResetPasswordDialog extends MageDialog {
|
|||
|
||||
connection = new Connection();
|
||||
connection.setHost(this.txtServer.getText().trim());
|
||||
connection.setPort(Integer.valueOf(this.txtPort.getText().trim()));
|
||||
connection.setPort(Integer.parseInt(this.txtPort.getText().trim()));
|
||||
PreferencesDialog.setProxyInformation(connection);
|
||||
connection.setEmail(this.txtEmail.getText().trim());
|
||||
connection.setAuthToken(this.txtAuthToken.getText().trim());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue