From 34ec2b54da52eeed39d9cf9e5f215650b447edd7 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Tue, 10 Apr 2012 13:25:33 -0700 Subject: [PATCH] Removed exception from SpannableStringBuilder Bug 6312196 Change-Id: I9cece36b40d8948e0e85bd433954818991009ad5 --- .../android/text/SpannableStringBuilder.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core/java/android/text/SpannableStringBuilder.java b/core/java/android/text/SpannableStringBuilder.java index 0f8efd10f4360..6056c75f3b967 100644 --- a/core/java/android/text/SpannableStringBuilder.java +++ b/core/java/android/text/SpannableStringBuilder.java @@ -18,6 +18,7 @@ package android.text; import android.graphics.Canvas; import android.graphics.Paint; +import android.util.Log; import com.android.internal.util.ArrayUtils; @@ -485,15 +486,12 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable // 0-length Spanned.SPAN_EXCLUSIVE_EXCLUSIVE if (flagsStart == POINT && flagsEnd == MARK && start == end) { - if (send) { - throw new IllegalArgumentException( - "SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length"); - } else { - // Silently ignore invalid spans when they are created from this class. - // This avoids the duplication of the above test code before all the - // calls to setSpan that are done in this class - return; - } + if (send) Log.e("SpannableStringBuilder", + "SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length"); + // Silently ignore invalid spans when they are created from this class. + // This avoids the duplication of the above test code before all the + // calls to setSpan that are done in this class + return; } int nstart = start;