Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362345 - TrimStack throws IAE
Summary: TrimStack throws IAE
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.2 M4   Edit
Assignee: Dean Roberts CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-28 12:54 EDT by Remy Suen CLA
Modified: 2011-12-06 13:12 EST (History)
3 users (show)

See Also:
pwebster: review+


Attachments
Fix for IAE exception and missing tool item (1.23 KB, patch)
2011-11-08 10:29 EST, Dean Roberts CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2011-10-28 12:54:50 EDT
I20111025-2000

Testing this morning and found several of these in my logs.

java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:4281)
	at org.eclipse.swt.SWT.error(SWT.java:4215)
	at org.eclipse.swt.SWT.error(SWT.java:4186)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
	at org.eclipse.swt.widgets.ToolBar.getItem(ToolBar.java:511)
	at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.fixToolItemSelection(TrimStack.java:173)
	at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.access$5(TrimStack.java:168)
	at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack$3.handleEvent(TrimStack.java:160)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4683)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:184)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
	at org.eclipse.e4.ui.workbench.UIEvents.publishEvent(UIEvents.java:207)
	at org.eclipse.e4.ui.workbench.UIEvents.publishEvent(UIEvents.java:177)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:565)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:530)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:519)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2763)
	at org.eclipse.ui.internal.WorkbenchPage.access$19(WorkbenchPage.java:2683)
	at org.eclipse.ui.internal.WorkbenchPage$7.run(WorkbenchPage.java:2665)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2661)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2620)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2603)
	at org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink.processSearchResult(JavaStackTraceHyperlink.java:153)
	at org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink$2.runInUIThread(JavaStackTraceHyperlink.java:130)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
Comment 1 Remy Suen CLA 2011-10-28 13:52:52 EDT
1. Minimize the shared area.
2. Ctrl+Shift+R > Open a file.
3. Activate a view so that the editor is minimized again. Many exceptions are in the log.
Comment 2 Dean Roberts CLA 2011-11-08 10:29:47 EST
Created attachment 206604 [details]
Fix for IAE exception and missing tool item

If the shared area is EMPTY, the minimize code was not adding the shared area tool item.  This, eventually, resulted in the IAE exception when the fix selection code attempted to index the missing tool item.

The fix allows the tool items data to be set to null.  I confirmed that the rest of the code in this class can handle the null data appropriately.
Comment 4 Dean Roberts CLA 2011-12-06 13:12:44 EST
Verified on I20111205-2330