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

Bug 338038

Summary: ArrayIndexOutOfBoundsException during continuous delete via delete key
Product: z_Archived Reporter: Raj Alagumalai <raj.alagumalai>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: konstantin, shenxue.zhou
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Raj Alagumalai CLA 2011-02-23 19:15:38 EST
Build Identifier: 0.2.1.201102221919



deleting multiple nodes via the delete key press causes arrayindexoutofboundsexception

open contacts.xml
add multiple contacts
place cursor on one of the contacts
and keep delete key pressed until all contacts are deleted

the .log has multiple instances of the following exception

java.lang.ArrayIndexOutOfBoundsException: -2
	at java.util.ArrayList.get(Unknown Source)
	at org.eclipse.sapphire.ui.swt.renderer.actions.internal.OutlineNodeDeleteActionHandler.run(OutlineNodeDeleteActionHandler.java:112)
	at org.eclipse.sapphire.ui.SapphireActionHandler.execute(SapphireActionHandler.java:89)
	at org.eclipse.sapphire.ui.swt.renderer.SapphireKeyboardActionPresentation$2.run(SapphireKeyboardActionPresentation.java:105)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)


Reproducible: Always

Steps to Reproduce:
open contacts.xml
add multiple contacts
place cursor on one of the contacts
and keep delete key pressed until all contacts are deleted
Comment 1 Raj Alagumalai CLA 2011-02-23 19:36:30 EST
tried this on a Helios Sr1 + sapphire 0.2.1 environment and can reproduce the issue

java.lang.ArrayIndexOutOfBoundsException: -2
at java.util.ArrayList.elementData(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.eclipse.sapphire.ui.swt.renderer.actions.internal.OutlineNodeDeleteActionHandler.run(OutlineNodeDeleteActionHandler.java:112)
at org.eclipse.sapphire.ui.SapphireActionHandler.execute(SapphireActionHandler.java:89)
at org.eclipse.sapphire.ui.swt.renderer.SapphireKeyboardActionPresentation$2.run(SapphireKeyboardActionPresentation.java:105)
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)
Comment 2 Konstantin Komissarchik CLA 2011-02-23 19:42:28 EST
Fixed in 0.2.1 and 0.3 streams.
Comment 3 Raj Alagumalai CLA 2011-02-24 03:29:53 EST
verified on build 161
Comment 4 Shenxue Zhou CLA 2011-02-25 12:53:50 EST
Raj has verified the fix.