Bug 1081317: Don't create redundant temporary objects when converting primitives to strings. r=rnewman
authorChris Kitching <chriskitching@linux.com>
Fri, 10 Oct 2014 21:53:22 +0100
changeset 209925 8eb295a430d482bafed4ebdd9c0a4cd2e4a1505a
parent 209924 1b962a92eff2f6f93b173ed5f664b218355c78a1
child 209926 f8ed92864d273b7561aa7dbe1600035f417d5ed9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersrnewman
bugs1081317
milestone35.0a1
Bug 1081317: Don't create redundant temporary objects when converting primitives to strings. r=rnewman * * * Bug 1081317: Don't create redundant temporary objects when converting primitives to strings. r=rnewman
mobile/android/base/db/PasswordsProvider.java
mobile/android/base/sync/config/ConfigurationMigrator.java
--- a/mobile/android/base/db/PasswordsProvider.java
+++ b/mobile/android/base/db/PasswordsProvider.java
@@ -171,17 +171,17 @@ public class PasswordsProvider extends S
             case PASSWORDS:
                 values.put(Passwords.TIME_CREATED, now);
 
                 // Generate GUID for new password. Don't override specified GUIDs.
                 if (!values.containsKey(Passwords.GUID)) {
                     String guid = Utils.generateGuid();
                     values.put(Passwords.GUID, guid);
                 }
-                String nowString = new Long(now).toString();
+                String nowString = Long.toString(now);
                 DBUtils.replaceKey(values, null, Passwords.HOSTNAME, "");
                 DBUtils.replaceKey(values, null, Passwords.HTTP_REALM, "");
                 DBUtils.replaceKey(values, null, Passwords.FORM_SUBMIT_URL, "");
                 DBUtils.replaceKey(values, null, Passwords.USERNAME_FIELD, "");
                 DBUtils.replaceKey(values, null, Passwords.PASSWORD_FIELD, "");
                 DBUtils.replaceKey(values, null, Passwords.ENCRYPTED_USERNAME, "");
                 DBUtils.replaceKey(values, null, Passwords.ENCRYPTED_PASSWORD, "");
                 DBUtils.replaceKey(values, null, Passwords.ENC_TYPE, "0");
--- a/mobile/android/base/sync/config/ConfigurationMigrator.java
+++ b/mobile/android/base/sync/config/ConfigurationMigrator.java
@@ -234,17 +234,17 @@ public class ConfigurationMigrator {
     }
     if (clientName != null) {
       Logger.debug(LOG_TAG, "Migrated client name.");
       accountManager.setUserData(account, V1_PREF_CLIENT_NAME, clientName);
       count += 1;
     }
     if (numClients > -1) {
       Logger.debug(LOG_TAG, "Migrated clients count.");
-      accountManager.setUserData(account, V1_PREF_NUM_CLIENTS, new Long(numClients).toString());
+      accountManager.setUserData(account, V1_PREF_NUM_CLIENTS, Long.toString(numClients));
       count += 1;
     }
     return count;
   }
 
   /**
    * Extract version 0 per-Android account user data and write to version 1 per-Sync account shared prefs.
    *