java.lang.StringIndexOutOfBoundsException: String index out of range: -2<br></p> <pre> <code>at java.lang.String.substring(String.java:1931)

Appcelerator JIRA | Ingo Muschenetz | 5 years ago
  1. 0

    {html}<div><h1>Create an HTML document</h1> <h1>Type &lt;, to get &lt;&gt;</h1> <h1>CA will pop up. try typing p, to select the "p" tag.</h1> <h1>Nothing will select.</h1> <p>A clue in the log file:</p> <p>!ENTRY org.eclipse.ui 4 0 2010-11-04 12:55:04.794 !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: -2)<br></p> <pre> <code>at org.eclipse.swt.SWT.error(SWT.java:4083) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3586) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)</code> </pre> <p>Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -2<br></p> <pre> <code>at java.lang.String.substring(String.java:1931) at java.lang.String.substring(String.java:1904) at com.aptana.editor.common.contentassist.CommonCompletionProposal.validate(CommonCompletionProposal.java:349) at com.aptana.editor.common.contentassist.CompletionProposalPopup.computeFilteredProposals(CompletionProposalPopup.java:1628) at com.aptana.editor.common.contentassist.CompletionProposalPopup.access$24(CompletionProposalPopup.java:1582) at com.aptana.editor.common.contentassist.CompletionProposalPopup$11.run(CompletionProposalPopup.java:1547) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) ... 23 more</code> </pre> <p>In my case, replacementString was 2 chars longer than displayString, so we were asking for a substring of -2.</p></div>{html}

    Appcelerator JIRA | 5 years ago | Ingo Muschenetz
    java.lang.StringIndexOutOfBoundsException: String index out of range: -2<br></p> <pre> <code>at java.lang.String.substring(String.java:1931)
  2. 0

    {html}<div><h1>Create an HTML document</h1> <h1>Type &lt;, to get &lt;&gt;</h1> <h1>CA will pop up. try typing p, to select the "p" tag.</h1> <h1>Nothing will select.</h1> <p>A clue in the log file:</p> <p>!ENTRY org.eclipse.ui 4 0 2010-11-04 12:55:04.794 !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: -2)<br></p> <pre> <code>at org.eclipse.swt.SWT.error(SWT.java:4083) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3586) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)</code> </pre> <p>Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -2<br></p> <pre> <code>at java.lang.String.substring(String.java:1931) at java.lang.String.substring(String.java:1904) at com.aptana.editor.common.contentassist.CommonCompletionProposal.validate(CommonCompletionProposal.java:349) at com.aptana.editor.common.contentassist.CompletionProposalPopup.computeFilteredProposals(CompletionProposalPopup.java:1628) at com.aptana.editor.common.contentassist.CompletionProposalPopup.access$24(CompletionProposalPopup.java:1582) at com.aptana.editor.common.contentassist.CompletionProposalPopup$11.run(CompletionProposalPopup.java:1547) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) ... 23 more</code> </pre> <p>In my case, replacementString was 2 chars longer than displayString, so we were asking for a substring of -2.</p></div>{html}

    Appcelerator JIRA | 5 years ago | Ingo Muschenetz
    java.lang.StringIndexOutOfBoundsException: String index out of range: -2<br></p> <pre> <code>at java.lang.String.substring(String.java:1931)
  3. 0

    StringIndexOutOfBoundsException on specific extractor pattern

    GitHub | 2 years ago | autopwn
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Connection problems lead to stalling edits.

    GitHub | 2 years ago | monicacecilia
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  6. 0

    export CDS fails

    GitHub | 2 years ago | nathandunn
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1

  1. archenroot 17 times, last 1 week ago
  2. Alexandru Popa 2 times, last 3 weeks ago
  3. poroszd 3 times, last 3 weeks ago
  4. DoktorDoener666 6 times, last 4 weeks ago
  5. eti22 3 times, last 1 month ago
16 more registered users
58 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.StringIndexOutOfBoundsException

    String index out of range: -2<br></p> <pre> <code>at java.lang.String.substring(String.java:1931)

    at java.lang.String.substring()
  2. Java RT
    String.substring
    1. java.lang.String.substring(String.java:1904)
    1 frame
  3. com.aptana.editor
    CompletionProposalPopup$11.run
    1. com.aptana.editor.common.contentassist.CommonCompletionProposal.validate(CommonCompletionProposal.java:349)
    2. com.aptana.editor.common.contentassist.CompletionProposalPopup.computeFilteredProposals(CompletionProposalPopup.java:1628)
    3. com.aptana.editor.common.contentassist.CompletionProposalPopup.access$24(CompletionProposalPopup.java:1582)
    4. com.aptana.editor.common.contentassist.CompletionProposalPopup$11.run(CompletionProposalPopup.java:1547)
    4 frames
  4. RWT
    Synchronizer.runAsyncMessages
    1. org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    2. org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    2 frames