Bug 1346390 - Use Long.parseLong instead of Long.valueOf for efficiency r=nalexander
MozReview-Commit-ID: 29fwjlxRqZ3
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java
@@ -833,20 +833,20 @@ public class AndroidFxAccount {
public synchronized long getDeviceRegistrationTimestamp() {
final String timestampStr = accountManager.getUserData(account, ACCOUNT_KEY_DEVICE_REGISTRATION_TIMESTAMP);
if (TextUtils.isEmpty(timestampStr)) {
return 0L;
}
- // Long.valueOf might throw; while it's not expected that this might happen, let's not risk
+ // Long.parseLong might throw; while it's not expected that this might happen, let's not risk
// crashing here as this method will be called on startup.
try {
- return Long.valueOf(timestampStr);
+ return Long.parseLong(timestampStr);
} catch (NumberFormatException e) {
Logger.warn(LOG_TAG, "Couldn't parse deviceRegistrationTimestamp; defaulting to 0L.", e);
return 0L;
}
}
public synchronized void setDeviceId(String id) {
accountManager.setUserData(account, ACCOUNT_KEY_DEVICE_ID, id);