Bug 1346390 - Use Long.parseLong instead of Long.valueOf for efficiency. r=nalexander, a=lizzard
authorGrigory Kruglov <gkruglov@mozilla.com>
Fri, 10 Mar 2017 13:17:51 -0800
changeset 376913 22b13a98b585eb90edceaee1df001fadf001175a
parent 376912 2556b0e3698c6e9c84acac63635f8a0f01b133d4
child 376914 137343d3973c4187fcc3c5aa0786dc9890c7b3b7
push id7086
push userryanvm@gmail.com
push dateWed, 22 Mar 2017 20:44:29 +0000
treeherdermozilla-beta@137343d3973c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, lizzard
bugs1346390
milestone53.0
Bug 1346390 - Use Long.parseLong instead of Long.valueOf for efficiency. r=nalexander, a=lizzard MozReview-Commit-ID: 29fwjlxRqZ3
mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java
--- 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);