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 85837 bbc7014db2de49e2301680d2a86be8a53108a88a
parent 85836 294b0fcf805b82675ce98dcc0a76264dbe9dd27a
child 85838 801015738a123a86458eba7e4f0b3f4bae3a668e
child 89049 ed29c74e3c01fb33e6298ec69fc95988df9ace73
push id21966
push userdougt@mozilla.com
push dateTue, 31 Jan 2012 17:25:36 +0000
treeherdermozilla-central@bbc7014db2de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalexp
bugs720092, 88168
milestone12.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 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));