Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a993100 authored by Jean Chalard's avatar Jean Chalard
Browse files

Fix a CTS test

SpannableStringBuilder should throw an exception when the
parameters to #insert and related methods are in the wrong
order.
We'll have to reopen b/9570771 and deal with it separately.

Bug: 14965397
Change-Id: I01847e0010d23f98ad3def8ba030d36570528900
parent edbfd040
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -440,26 +440,10 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable
    }

    // Documentation from interface
    public SpannableStringBuilder replace(int start, int end,
    public SpannableStringBuilder replace(final int start, final int end,
            CharSequence tb, int tbstart, int tbend) {
        checkRange("replace", start, end);

        // Sanity check
        if (start > end) {
            Log.w(TAG, "Bad arguments to #replace : "
                    + "start = " + start + ", end = " + end);
            final int tmp = start;
            start = end;
            end = tmp;
        }
        if (tbstart > tbend) {
            Log.w(TAG, "Bad arguments to #replace : "
                    + "tbstart = " + tbstart + ", tbend = " + tbend);
            final int tmp = tbstart;
            tbstart = tbend;
            tbend = tmp;
        }

        int filtercount = mFilters.length;
        for (int i = 0; i < filtercount; i++) {
            CharSequence repl = mFilters[i].filter(tb, tbstart, tbend, this, start, end);
+0 −1
Original line number Diff line number Diff line
@@ -5842,7 +5842,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                int end = text.partialEndOffset;
                if (end > N) end = N;
                removeParcelableSpans(content, start, end);
                // If start > end, content.replace will swap them before using them.
                content.replace(start, end, text.text);
            }
        }