Closed Bug 1043624 Opened 10 years ago Closed 10 years ago

Style search term: IndexOutOfBoundsException: setSpan (7 ... 5) has end before start

Categories

(Firefox for Android Graveyard :: Search Activity, defect, P1)

All
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: eedens, Assigned: Margaret)

References

Details

Attachments

(2 files)

Attached file Stack trace
Intermittent crash while get search suggestions. Attached is a logcat stacktrace.

Repro steps aren't clear, but it seems to happen while typing / clearing rapidly.


(Followup to Bug 1029682.)
I wasn't able to reproduce this, but I looked into it and realized we were using this API incorrectly:
http://developer.android.com/reference/android/text/SpannableString.html#setSpan%28java.lang.Object,%20int,%20int,%20int%29

So, if the match isn't at the beginning of the string, we can run into this crash.

PR here: https://github.com/ericedens/FirefoxSearch/pull/34
Attachment #8462614 - Flags: review?(eric.edens)
Comment on attachment 8462614 [details] [diff] [review]
Set correct end for SpannableString

Review of attachment 8462614 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good!
Attachment #8462614 - Flags: review?(eric.edens) → review+
https://hg.mozilla.org/mozilla-central/rev/ceab6297c502
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
eedens, friendly reminder: you should link to FirefoxSearch commits when you merge them. I just had to double check that this patch made it in:

https://github.com/ericedens/FirefoxSearch/commit/648dae0c94391ba179d1b3adbaf30a5b243f6228
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: