Bug 717869 - fix BrowserProvider.generateGuid to not append trailing newlines. r=blassey, approval-mozilla-aurora=dougt
authorRichard Newman <rnewman@mozilla.com>
Sat, 14 Jan 2012 09:20:30 -0800
changeset 85153 38777175ae7746a077a8e0138927ab6d612b4744
parent 85152 02093039f45420e96bdbe32bd54c52f87b350706
child 85154 fa0ab73ef86fb7e4f31cbf652059bb85ce03b393
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs717869
milestone11.0a2
Bug 717869 - fix BrowserProvider.generateGuid to not append trailing newlines. r=blassey, approval-mozilla-aurora=dougt
mobile/android/base/db/BrowserProvider.java.in
--- a/mobile/android/base/db/BrowserProvider.java.in
+++ b/mobile/android/base/db/BrowserProvider.java.in
@@ -203,18 +203,20 @@ public class BrowserProvider extends Con
     }
 
     private HashMap<String, DatabaseHelper> mDatabasePerProfile;
 
     static final String qualifyColumn(String table, String column) {
         return table + "." + column;
     }
 
+    private static final int GUID_ENCODE_FLAGS = Base64.URL_SAFE | Base64.NO_WRAP;
+
     public static String generateGuid() {
-        byte[] encodedBytes = Base64.encode(generateRandomBytes(9), Base64.URL_SAFE);
+        byte[] encodedBytes = Base64.encode(generateRandomBytes(9), GUID_ENCODE_FLAGS);
         return new String(encodedBytes);
     }
 
     private static byte[] generateRandomBytes(int length) {
         byte[] bytes = new byte[length];
 
         Random random = new Random(System.nanoTime());
         random.nextBytes(bytes);