Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332501 - Team -> Commit -> Amend to the previous commit -> StringIndexOutOfBoundsException
Summary: Team -> Commit -> Amend to the previous commit -> StringIndexOutOfBoundsExcep...
Status: CLOSED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 0.11-M2   Edit
Assignee: Jens Baumgart CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-14 04:50 EST by Svetlomira CLA
Modified: 2011-06-14 07:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Svetlomira CLA 2010-12-14 04:50:29 EST
What I did:

1.	I edited some files in the project that is already cloned.
2.	I have a commit and I pushed this commit.
3.	Now I made improvements in the code and I want to “amend to the previous commit”
4.	Team -> Commit -> Amend to the previous commit 
5.	I get exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: -188
	at java.lang.String.substring(String.java:1937)
	at org.eclipse.egit.ui.internal.dialogs.CommitDialog.saveOriginalChangeId(CommitDialog.java:419)
	at org.eclipse.egit.ui.internal.dialogs.CommitDialog.access$4(CommitDialog.java:413)
	at org.eclipse.egit.ui.internal.dialogs.CommitDialog$3.widgetSelected(CommitDialog.java:261)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.egit.ui.internal.actions.CommitActionHandler.execute(CommitActionHandler.java:166)
	at org.eclipse.egit.ui.internal.actions.RepositoryAction.run(RepositoryAction.java:77)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	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:368)
	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:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Comment 1 Jens Baumgart CLA 2011-01-12 10:23:33 EST
Can be reproduced if the commit message ends with the change id but without line end.
Comment 2 Jens Baumgart CLA 2011-01-12 10:24:51 EST
Fix proposed: http://egit.eclipse.org/r/2241
Comment 3 Benjamin Muskalla CLA 2011-04-29 05:54:46 EDT
Seems this has already been merged. Jens, can this be closed?