java.lang.IndexOutOfBoundsException: replace (13 ... 14) ends beyond length 13

GitHub | jgabrielfreitas | 5 months ago
  1. 0

    [BUG] IndexOutOfBoundsException in replace

    GitHub | 5 months ago | jgabrielfreitas
    java.lang.IndexOutOfBoundsException: replace (13 ... 14) ends beyond length 13
  2. 0

    IndexOutOfBoundsException

    GitHub | 1 year ago | msya
    java.lang.IndexOutOfBoundsException: replace (28 ... 36) ends beyond length 32
  3. 0

    cutting text at the end of textarea with big content crashed ============================================== Code to reproduce the bug + Logcat are on github: - https://github.com/bdedardel/cordova-test Description ----------- When I cut some text at the end of a textarea with big content, using android native copy/cut/paste, application crashes. - If I build android app with cordova, it seems ok. - If I build android app with crosswalk plugin, application crashes (IndexOutOfBoundsException). ### Steps - run ./bin/build.sh - install and open cordova-test-nok.apk on the android mobile phone - goto line 1951/2000 and cut it, everything is ok - close app and reopen it - goto line 1952/2000 and cut it, application crashes ### Environment - cordova 5.1.1 Tested on: - Wiko Darkmoon, android 4.2.2 - LG G2, android 5.0.2 Debug ------ ### Stack trace Trace (from Logcat, see: https://github.com/bdedardel/cordova-test/blob/master/bugs/BUG001.md) ``` W/System.err(18785): java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0 W/System.err(18785): at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1021) W/System.err(18785): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:484) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30) W/System.err(18785): at org.chromium.content.browser.input.AdapterInputConnection.updateState(AdapterInputConnection.java:184) W/System.err(18785): at org.chromium.content.browser.ContentViewCore.updateImeAdapter(ContentViewCore.java:2322) W/System.err(18785): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) W/System.err(18785): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53) W/System.err(18785): at android.os.Handler.dispatchMessage(Handler.java:107) W/System.err(18785): at android.os.Looper.loop(Looper.java:194) W/System.err(18785): at android.app.ActivityThread.main(ActivityThread.java:5391) W/System.err(18785): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(18785): at java.lang.reflect.Method.invoke(Method.java:525) W/System.err(18785): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) W/System.err(18785): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) W/System.err(18785): at dalvik.system.NativeStart.main(Native Method) F/chromium(18785): [FATAL:jni_android.cc(295)] Check failed: false. Please include Java exception stack in crash report F/libc (18785): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 18785 (del.CordovaTest) F/libc (18785): Send stop signal to pid:18785 in debugger_signal_handler ```

    JIRA | 1 year ago | bdedardel
    java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    IndexOutOfBoundsException

    GitHub | 10 months ago | olegosipenko
    java.lang.IndexOutOfBoundsException: replace (15 ... 16) ends beyond length 15
  6. 0

    cutting text at the end of textarea with big content crashed ============================================== Code to reproduce the bug + Logcat are on github: - https://github.com/bdedardel/cordova-test Description ----------- When I cut some text at the end of a textarea with big content, using android native copy/cut/paste, application crashes. - If I build android app with cordova, it seems ok. - If I build android app with crosswalk plugin, application crashes (IndexOutOfBoundsException). ### Steps - run ./bin/build.sh - install and open cordova-test-nok.apk on the android mobile phone - goto line 1951/2000 and cut it, everything is ok - close app and reopen it - goto line 1952/2000 and cut it, application crashes ### Environment - cordova 5.1.1 Tested on: - Wiko Darkmoon, android 4.2.2 - LG G2, android 5.0.2 Debug ------ ### Stack trace Trace (from Logcat, see: https://github.com/bdedardel/cordova-test/blob/master/bugs/BUG001.md) ``` W/System.err(18785): java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0 W/System.err(18785): at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1021) W/System.err(18785): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:484) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30) W/System.err(18785): at org.chromium.content.browser.input.AdapterInputConnection.updateState(AdapterInputConnection.java:184) W/System.err(18785): at org.chromium.content.browser.ContentViewCore.updateImeAdapter(ContentViewCore.java:2322) W/System.err(18785): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) W/System.err(18785): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53) W/System.err(18785): at android.os.Handler.dispatchMessage(Handler.java:107) W/System.err(18785): at android.os.Looper.loop(Looper.java:194) W/System.err(18785): at android.app.ActivityThread.main(ActivityThread.java:5391) W/System.err(18785): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(18785): at java.lang.reflect.Method.invoke(Method.java:525) W/System.err(18785): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) W/System.err(18785): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) W/System.err(18785): at dalvik.system.NativeStart.main(Native Method) F/chromium(18785): [FATAL:jni_android.cc(295)] Check failed: false. Please include Java exception stack in crash report F/libc (18785): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 18785 (del.CordovaTest) F/libc (18785): Send stop signal to pid:18785 in debugger_signal_handler ```

    JIRA | 1 year ago | bdedardel
    java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IndexOutOfBoundsException

      replace (13 ... 14) ends beyond length 13

      at android.text.SpannableStringBuilder.checkRange()
    2. Android Platform
      SpannableStringBuilder.replace
      1. android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1264)
      2. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516)
      3. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:510)
      4. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:509)
      4 frames
    3. com.github.pinball83
      MaskedMaterialEditText$MaskedInputFilter.filter
      1. com.github.pinball83.maskededittext.MaskedMaterialEditText$MaskedInputFilter.filter(MaskedMaterialEditText.java:328)
      1 frame
    4. Android Platform
      ViewGroup.dispatchKeyEvent
      1. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:520)
      2. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:510)
      3. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:509)
      4. android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:121)
      5. android.widget.TextView.doKeyDown(TextView.java:6280)
      6. android.widget.TextView.onKeyDown(TextView.java:6070)
      7. android.view.KeyEvent.dispatch(KeyEvent.java:2675)
      8. android.view.View.dispatchKeyEvent(View.java:9876)
      9. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      10. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      11. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      12. android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:379)
      13. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      14. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      14 frames
    5. Android Support v4
      ViewPager.dispatchKeyEvent
      1. android.support.v4.view.ViewPager.dispatchKeyEvent(ViewPager.java:2652)
      1 frame
    6. Android Platform
      ViewGroup.dispatchKeyEvent
      1. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      2. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      3. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      4. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      5. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      6. android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
      6 frames
    7. Android
      PhoneWindow.superDispatchKeyEvent
      1. com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:402)
      2. com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1787)
      2 frames
    8. Android Platform
      Activity.dispatchKeyEvent
      1. android.app.Activity.dispatchKeyEvent(Activity.java:3020)
      1 frame
    9. Android v7
      AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent
      1. android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:534)
      2. android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
      3. android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
      3 frames
    10. Android
      DecorView.dispatchKeyEvent
      1. com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:316)
      1 frame
    11. Android Platform
      Handler.dispatchMessage
      1. android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4297)
      2. android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4268)
      3. android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3819)
      4. android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3872)
      5. android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3838)
      6. android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3965)
      7. android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3846)
      8. android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4022)
      9. android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3819)
      10. android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3872)
      11. android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3838)
      12. android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3846)
      13. android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3819)
      14. android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6180)
      15. android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6154)
      16. android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6115)
      17. android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3617)
      18. android.os.Handler.dispatchMessage(Handler.java:102)
      18 frames