Tidy up uses of Integer.valueOf.
Use parseInt when the result is assigned to an int. Allocates fewer objects. bug: 28078871 Change-Id: Icbb0507949b71bc0a729f2e65309dab939b3d853
This commit is contained in:
@@ -138,8 +138,8 @@ public class CubeWallpaper2 extends WallpaperService {
|
||||
for (int i = 0; i < numlines; i++) {
|
||||
mLines[i] = new ThreeDLine();
|
||||
String [] idx = l[i].split(" ");
|
||||
mLines[i].startPoint = Integer.valueOf(idx[0]);
|
||||
mLines[i].endPoint = Integer.valueOf(idx[1]);
|
||||
mLines[i].startPoint = Integer.parseInt(idx[0]);
|
||||
mLines[i].endPoint = Integer.parseInt(idx[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ public class AddFileActivity extends Activity {
|
||||
return;
|
||||
}
|
||||
|
||||
long fileSize = Integer.valueOf(fileSizeEditTextValue) * mSizeMultiplier;
|
||||
long fileSize = Long.parseLong(fileSizeEditTextValue) * mSizeMultiplier;
|
||||
|
||||
if (mFileStorage == FileStorage.EXTERNAL && !Utils.isExternalStorageAvailable()) {
|
||||
Toast toast = Toast.makeText(this,
|
||||
|
||||
@@ -260,13 +260,13 @@ public class PolicySetupActivity extends Activity {
|
||||
|
||||
int passwordLength = 0;
|
||||
try {
|
||||
passwordLength = Integer.valueOf(mPasswordLengthInputField.getText().toString());
|
||||
passwordLength = Integer.parseInt(mPasswordLengthInputField.getText().toString());
|
||||
} catch (NumberFormatException nfe) {} // Defaults to 0.
|
||||
|
||||
int passwordMinUppercase = 0;
|
||||
try {
|
||||
passwordMinUppercase =
|
||||
Integer.valueOf(mPasswordMinUppercaseInputField.getText().toString());
|
||||
Integer.parseInt(mPasswordMinUppercaseInputField.getText().toString());
|
||||
} catch (NumberFormatException nfe) {} // Defaults to 0.
|
||||
|
||||
mPolicy.saveToLocal(passwordQuality, passwordLength, passwordMinUppercase);
|
||||
|
||||
Reference in New Issue
Block a user