Bug 720092 - java.lang.IndexOutOfBoundsException: getChars (0 ... 88168) ends beyond length 0. We do not know why this is happening yet. This patch catches the throw and logs what values we have for start and end. r=alexp AURORA_BASE_20120131
authorDoug Turner <dougt@dougt.org>
Tue, 31 Jan 2012 09:24:31 -0800
changeset 87062 bbc7014db2de49e2301680d2a86be8a53108a88a
parent 87061 294b0fcf805b82675ce98dcc0a76264dbe9dd27a
child 87063 9fe9199410e89b6c239745d0a9c45900701f06ef
child 87352 801015738a123a86458eba7e4f0b3f4bae3a668e
child 90861 ed29c74e3c01fb33e6298ec69fc95988df9ace73
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalexp
bugs720092, 88168
milestone12.0a1
Bug 720092 - java.lang.IndexOutOfBoundsException: getChars (0 ... 88168) ends beyond length 0. We do not know why this is happening yet. This patch catches the throw and logs what values we have for start and end. r=alexp
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -201,18 +201,26 @@ public class GeckoInputConnection
             a = b;
             b = tmp;
         }
 
         extract.selectionStart = a;
         extract.selectionEnd = b;
 
         extract.startOffset = 0;
-        extract.text = content.toString();
 
+        try {
+            extract.text = content.toString();
+        } catch (IndexOutOfBoundsException iob) {
+            Log.d(LOGTAG,
+                  "IndexOutOfBoundsException thrown from getExtractedText(). start: " +
+                  Selection.getSelectionStart(content) +
+                  " end: " + Selection.getSelectionEnd(content));
+            return null;
+        }
         return extract;
     }
 
     @Override
     public boolean setSelection(int start, int end) {
         GeckoAppShell.sendEventToGecko(
             new GeckoEvent(GeckoEvent.IME_SET_SELECTION, start, end - start));