Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364488

Summary: StringIndexOutOfBoundsException when opening commit dialog
Product: [Technology] EGit Reporter: Steffen Pingel <steffen.pingel>
Component: UIAssignee: Kevin Sawicki <kevin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jens.baumgart
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Steffen Pingel CLA 2011-11-22 11:22:44 EST
What steps will reproduce the problem?
1. Switched to a branch
2. Opened commit dialog. This would log the exception.
3. Tried to amend commit

The commit message would not get replaced with the previous message.

-- Commit details --

commit 886d10135c41a13b1f86191d89d1fa931a085ca3
Author: Steffen Pingel <steffen.pingel@tasktop.com> 2011-11-20 17:49:07
Committer: Steffen Pingel <steffen.pingel@tasktop.com> 2011-11-20 17:49:07
Parent: cef53c5e802bf3b8adcc58a29eeea3db765f9e52 (NEW - bug 362259: ClassCastException generated when double-clicking on Comment Element  https://bugs.eclipse.org/bugs/show_bug.cgi?id=362259)
Branches: bug#357288-clone-wizard

automatically create repository if fetching a patch set 

Bug: 357288
Change-Id: I487cec45e66fc1c44ee60066bc63d8d7a830f4b3

-- Error Details --
Date: Tue Nov 22 17:17:24 CET 2011
Message: Unhandled event loop exception
Severity: Error
Product: Eclipse SDK 3.8.0.v201110271800 (org.eclipse.sdk.ide)
Plugin: org.eclipse.ui
Session Data:
eclipse.buildId=I20111027-1800
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_CA

Exception Stack Trace:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1931)
	at java.lang.String.substring(String.java:1904)
	at org.eclipse.egit.ui.internal.dialogs.CommitMessageComponent.refreshChangeIdText(CommitMessageComponent.java:605)
	at org.eclipse.egit.ui.internal.dialogs.CommitMessageComponent.setAmendingButtonSelection(CommitMessageComponent.java:275)
	at org.eclipse.egit.ui.internal.dialogs.CommitDialog$9.widgetSelected(CommitDialog.java:723)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
...
Comment 1 Kevin Sawicki CLA 2011-11-22 13:46:04 EST
Proposed fix pushed to: http://egit.eclipse.org/r/#change,4664
Comment 2 Jens Baumgart CLA 2011-11-28 08:43:17 EST
Fixed with commit e1402c380f02c58f931531e5d75ade6af0712420