Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332410 - StringIndexOutOfBoundsException when loading launch configurations at startup
Summary: StringIndexOutOfBoundsException when loading launch configurations at startup
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-13 01:52 EST by Mauro Molinari CLA
Modified: 2011-01-24 16:44 EST (History)
2 users (show)

See Also:
curtis.windatt.public: review+


Attachments
My launch history (2.01 KB, application/xml)
2010-12-13 15:41 EST, Mauro Molinari CLA
no flags Details
fix (1.47 KB, patch)
2011-01-06 10:37 EST, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari CLA 2010-12-13 01:52:09 EST
Build Identifier: M20100909-0800

Whenever I start Eclipse I get this in the error log and the list of the recent run/debug configurations is not populated correctly (I always see just some very old run/debug configurations used a long time ago).

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.getSimpleName(LaunchConfiguration.java:185)
at org.eclipse.debug.internal.core.LaunchConfiguration.<init>(LaunchConfiguration.java:224)
at org.eclipse.debug.internal.core.LaunchManager.getLaunchConfiguration(LaunchManager.java:1375)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.getLaunchConfigurations(LaunchConfigurationManager.java:602)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.restoreHistory(LaunchConfigurationManager.java:567)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.restoreLaunchHistory(LaunchConfigurationManager.java:545)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.loadLaunchHistories(LaunchConfigurationManager.java:1080)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.getLaunchHistory(LaunchConfigurationManager.java:1052)
at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.internalGetHistory(AbstractLaunchHistoryAction.java:525)
at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.getToolTip(AbstractLaunchHistoryAction.java:228)
at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.updateTooltip(AbstractLaunchHistoryAction.java:194)
at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.initialize(AbstractLaunchHistoryAction.java:164)
at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.selectionChanged(AbstractLaunchHistoryAction.java:493)
at org.eclipse.ui.internal.PluginAction.refreshEnablement(PluginAction.java:206)
at org.eclipse.ui.internal.PluginAction.createDelegate(PluginAction.java:126)
at org.eclipse.ui.internal.WWinPluginAction.refreshActionList(WWinPluginAction.java:165)
at org.eclipse.ui.plugin.AbstractUIPlugin$1.run(AbstractUIPlugin.java:486)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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)


Reproducible: Always

Steps to Reproduce:
1. start Eclipse
Comment 1 Michael Rennie CLA 2010-12-13 11:21:41 EST
Can you attach your launch history?

The launch history is saved in:
<workspace>/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
Comment 2 Mauro Molinari CLA 2010-12-13 15:41:48 EST
Created attachment 185092 [details]
My launch history

Here is my launch history, as you requested. Thank you!
Comment 3 Michael Rennie CLA 2010-12-13 16:03:24 EST
It would seem that our logic for finding the simple name of a configuration does not work for configurations named 'launch.launch'

Steps:

1. create a simple hello world Java class
2. create a new Java Application launch configuration for the hello world class
3. rename the new launch configuration to 'launch' (minus the quotes)
4. launch it so it appears in the launch history
5. restart Eclipse
6. check your log - you will have the exception mentioned in comment #0
Comment 4 Michael Rennie CLA 2011-01-06 10:37:06 EST
Created attachment 186176 [details]
fix
Comment 5 Michael Rennie CLA 2011-01-06 11:25:55 EST
applied path to HEAD + some unit tests

please verify Curtis.
Comment 6 Curtis Windatt CLA 2011-01-24 16:44:38 EST
Verified.