decoro
decoro copied to clipboard
StringIndexOutOfBoundsException
Падение воспроизводится при двух условиях: в маске есть буквы, на редактируемом поле не отключены "suggestion". Достаточно просто заполнить поле и начать удалять символы, пока не дойдем до буквы из маски.
java.lang.StringIndexOutOfBoundsException: length=15; index=16 at java.lang.String.substring(String.java:1971) at ru.tinkoff.decoro.watchers.FormatWatcher.afterTextChanged(FormatWatcher.java:252) at android.widget.TextView.sendAfterTextChanged(TextView.java:9375) at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:11917) at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:1262) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:574) at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:229) at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:227) at android.text.method.BaseKeyListener.backspaceOrForwardDelete(BaseKeyListener.java:370) at android.text.method.BaseKeyListener.backspace(BaseKeyListener.java:71) at android.text.method.BaseKeyListener.onKeyDown(BaseKeyListener.java:479) at android.text.method.QwertyKeyListener.onKeyDown(QwertyKeyListener.java:362) at android.text.method.TextKeyListener.onKeyDown(TextKeyListener.java:141) at android.widget.TextView.doKeyDown(TextView.java:7316) at android.widget.TextView.onKeyDown(TextView.java:7093) at android.view.KeyEvent.dispatch(KeyEvent.java:2688) at android.view.View.dispatchKeyEvent(View.java:11658) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827) at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:437) at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1818) at android.app.Activity.dispatchKeyEvent(Activity.java:3252) at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:537) at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:58) at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:336) at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:58) at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:351) at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4714) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4586) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4274) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4331) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4307) at android.view.ViewRootImpl$ImeInputStage.onFinishedInput