Bug 746035 - Make some more constant strings in the Migrator static. r=lucasr a=blocking-fennec
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Thu, 19 Apr 2012 16:41:53 +0200
changeset 95276 e320015d6348b094f0209a9170b4dae603a35e63
parent 95275 a9ee797ccd070edaae8a75cb8e786e8af9b6354b
child 95277 76c80a198ebae612b4d181f3ade781dd7e18d4c1
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, blocking-fennec
bugs746035
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 746035 - Make some more constant strings in the Migrator static. r=lucasr a=blocking-fennec
mobile/android/base/ProfileMigrator.java
--- a/mobile/android/base/ProfileMigrator.java
+++ b/mobile/android/base/ProfileMigrator.java
@@ -111,20 +111,20 @@ public class ProfileMigrator {
     // Number of history entries already migrated.
     private static final String PREFS_MIGRATE_HISTORY_COUNT = "history_count";
     private static final String PREFS_MIGRATE_SYNC_DONE = "sync_done";
 
     /*
        These queries are derived from the low-level Places schema
        https://developer.mozilla.org/en/The_Places_database
     */
-    private final String kRootQuery =
+    private static final String kRootQuery =
         "SELECT root_name, folder_id FROM moz_bookmarks_roots";
-    private final String kRootName     = "root_name";
-    private final String kRootFolderId = "folder_id";
+    private static final String kRootName     = "root_name";
+    private static final String kRootFolderId = "folder_id";
 
     private static final String kBookmarkQuerySelect =
         "SELECT places.url             AS p_url,"         +
         "       bookmark.guid          AS b_guid,"        +
         "       bookmark.id            AS b_id,"          +
         "       bookmark.title         AS b_title,"       +
         "       bookmark.type          AS b_type,"        +
         "       bookmark.parent        AS b_parent,"      +
@@ -156,38 +156,38 @@ public class ProfileMigrator {
     private static final String kBookmarkQueryNoGuid =
         kBookmarkQuerySelect                              +
         "       favicon.data           AS f_data,"        +
         "       favicon.mime_type      AS f_mime_type,"   +
         "       favicon.url            AS f_url "         +
         kBookmarkQueryTrailer;
 
     // Result column of relevant data
-    private final String kBookmarkUrl      = "p_url";
-    private final String kBookmarkTitle    = "b_title";
-    private final String kBookmarkGuid     = "b_guid";
-    private final String kBookmarkId       = "b_id";
-    private final String kBookmarkType     = "b_type";
-    private final String kBookmarkParent   = "b_parent";
-    private final String kBookmarkAdded    = "b_added";
-    private final String kBookmarkModified = "b_modified";
-    private final String kBookmarkPosition = "b_position";
-    private final String kFaviconData      = "f_data";
-    private final String kFaviconMime      = "f_mime_type";
-    private final String kFaviconUrl       = "f_url";
-    private final String kFaviconGuid      = "f_guid";
+    private static final String kBookmarkUrl      = "p_url";
+    private static final String kBookmarkTitle    = "b_title";
+    private static final String kBookmarkGuid     = "b_guid";
+    private static final String kBookmarkId       = "b_id";
+    private static final String kBookmarkType     = "b_type";
+    private static final String kBookmarkParent   = "b_parent";
+    private static final String kBookmarkAdded    = "b_added";
+    private static final String kBookmarkModified = "b_modified";
+    private static final String kBookmarkPosition = "b_position";
+    private static final String kFaviconData      = "f_data";
+    private static final String kFaviconMime      = "f_mime_type";
+    private static final String kFaviconUrl       = "f_url";
+    private static final String kFaviconGuid      = "f_guid";
 
     // Helper constants
     private static final int kPlacesTypeBookmark = 1;
     private static final int kPlacesTypeFolder   = 2;
 
     /*
       For statistics keeping.
     */
-    private final String kHistoryCountQuery =
+    private static final String kHistoryCountQuery =
         "SELECT COUNT(*) FROM moz_historyvisits";
 
     /*
       The sort criterion here corresponds to the one used for the
       Awesomebar results. It's a simplification of Frecency.
       We must divide date by 1000 due to the micro (Places)
       vs milli (Android) distiction.
     */
@@ -233,29 +233,29 @@ public class ProfileMigrator {
     private static final String kHistoryTitle  = "p_title";
     private static final String kHistoryGuid   = "p_guid";
     private static final String kHistoryDate   = "h_date";
     private static final String kHistoryVisits = "h_visits";
 
     /*
       Sync settings to get from prefs.js.
     */
-    private final String[] kSyncSettingsList = new String[] {
+    private static final String[] kSyncSettingsList = new String[] {
         "services.sync.account",
         "services.sync.client.name",
         "services.sync.client.GUID",
         "services.sync.serverURL",
         "services.sync.clusterURL"
     };
 
     /*
       Sync settings to get from password manager.
     */
-    private final String kSyncHostName = "chrome://weave";
-    private final String[] kSyncRealmList = new String[] {
+    private static final String kSyncHostName = "chrome://weave";
+    private static final String[] kSyncRealmList = new String[] {
         "Mozilla Services Password",
         "Mozilla Services Encryption Passphrase"
     };
 
 
     public ProfileMigrator(Context context, File profileDir) {
         mProfileDir = profileDir;
         mContext = context;