java.lang.StringIndexOutOfBoundsException: String index out of range: -2)<br></p> <pre> <code>at org.eclipse.swt.SWT.error(SWT.java:4083)

Appcelerator JIRA | Ingo Muschenetz | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  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 | 6 years ago | Ingo Muschenetz
    java.lang.StringIndexOutOfBoundsException: String index out of range: -2)<br></p> <pre> <code>at org.eclipse.swt.SWT.error(SWT.java:4083)
  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 | 6 years ago | Ingo Muschenetz
    java.lang.StringIndexOutOfBoundsException: String index out of range: -2)<br></p> <pre> <code>at org.eclipse.swt.SWT.error(SWT.java:4083)
  3. 0

    Running of A Basic Feature Project Causes Exceptions

    Eclipse Bugzilla | 1 decade ago | dfigoni
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    StringIndexOutOfBoundsException in console

    Eclipse Bugzilla | 1 decade ago | brockj
    java.lang.StringIndexOutOfBoundsException: String index out of range: 1620)

    Root Cause Analysis

    1. 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()
    2. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.SWT.error(SWT.java:3998)
      2. org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
      3. org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3586)
      4. org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279)
      4 frames
    3. Eclipse UI
      Workbench$7.run
      1. org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
      2. org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
      3. org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
      4. org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
      4 frames
    4. Databinding
      Realm.runWithDefault
      1. org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      1 frame
    5. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
      1 frame
    6. Eclipse UI
      PlatformUI.createAndRunWorkbench
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      1 frame
    7. Eclipse IDE
      IDEApplication.start
      1. org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
      1 frame
    8. Equinox Container
      EclipseAppHandle.run
      1. org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      1 frame
    9. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      2. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      3. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
      4. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      4 frames
    10. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    11. Equinox
      Main.run
      1. org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
      2. org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      3. org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      3 frames