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

Bug 316783

Summary: Unable to open certain views
Product: [Eclipse Project] e4 Reporter: John Arthorne <john.arthorne>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: critical    
Priority: P3 CC: pwebster, remy.suen
Version: 1.0   
Target Milestone: 1.0 RC0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch that sets the 'CurSharedRef' when creating the CTabItem none

Description John Arthorne CLA 2010-06-14 12:03:32 EDT
4.0 SDK I20100613-2136

I am unable to open views in this build. Window > Show View does nothing, and opening a view from Quick Access throws exceptions:

java.lang.IllegalArgumentException: Index out of bounds
        at org.eclipse.swt.SWT.error(SWT.java:4064)
        at org.eclipse.swt.SWT.error(SWT.java:3998)
        at org.eclipse.swt.SWT.error(SWT.java:3969)
        at org.eclipse.swt.custom.CTabFolder.createItem(CTabFolder.java:432)
        at org.eclipse.swt.custom.CTabItem.<init>(CTabItem.java:119)
        at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.createTab(StackRenderer.java:298)
        at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:467)
        at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:73)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:41)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:188)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:198)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:139)
        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:73)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
        at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:159)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:219)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:357)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:563)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:621)
        at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:679)
        at org.eclipse.ui.internal.WorkbenchPage$6.run(WorkbenchPage.java:2258)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:2255)
        at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:2231)
        at org.eclipse.ui.internal.quickaccess.ViewElement.execute(ViewElement.java:38)
        at org.eclipse.ui.internal.quickaccess.QuickAccessDialog.handleElementSelected(QuickAccessDialog.java:687)
        at org.eclipse.ui.internal.quickaccess.QuickAccessDialog.handleSelection(QuickAccessDialog.java:764)
        at org.eclipse.ui.internal.quickaccess.QuickAccessDialog.access$6(QuickAccessDialog.java:754)
        at org.eclipse.ui.internal.quickaccess.QuickAccessDialog$3.keyPressed(QuickAccessDialog.java:179)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:161)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
        at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1427)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
        at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
        at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
        at org.eclipse.swt.widgets.Text.WM_CHAR(Text.java:2175)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
        at org.eclipse.swt.widgets.Text.windowProc(Text.java:2170)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$3.run(PartRenderingEngine.java:607)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:540)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:102)
        at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:535)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:521)
        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(NativeMethodAccessorImpl.java:64)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        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 1 John Arthorne CLA 2010-06-14 12:04:08 EDT
Actually it appears to be only certain views that cause this error: History view and Error log view so far.
Comment 2 Remy Suen CLA 2010-06-14 12:06:38 EDT
We've observed this in the past (bug 314897) but I haven't been able to reproduce it consistently.
Comment 3 Paul Webster CLA 2010-06-14 14:58:41 EDT
Also on I20100613-2136.

With no deltas.xml, I opened the Console view and History view, then close Declarations, Javadoc, and accidentally Console view.  When I went to re-open the Console view, it started in on me again:


2010-06-14 14:56:30.588 Log ErrorException while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/ui/ElementContainer/selectedElement/SET] to handler org.eclipse.e4.ui.services.internal.events.UIEventHandler@4b004b
java.lang.IllegalArgumentException: Index out of bounds
        at org.eclipse.swt.SWT.error(SWT.java:4064)
        at org.eclipse.swt.SWT.error(SWT.java:3998)
        at org.eclipse.swt.SWT.error(SWT.java:3969)
        at org.eclipse.swt.custom.CTabFolder.createItem(CTabFolder.java:432)
        at org.eclipse.swt.custom.CTabItem.<init>(CTabItem.java:119)
        at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.createTab(StackRenderer.java:298)
        at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:467)
        at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:73)
Comment 4 Remy Suen CLA 2010-06-14 16:47:16 EDT
(In reply to comment #3)
> Also on I20100613-2136.

Confirmed. The 'Javadoc' view's placeholder's TBR flag is true so the calculated offset is incorrect.
Comment 5 Remy Suen CLA 2010-06-14 17:07:25 EDT
I've delivered a workaround to StackRenderer.

If a shared part hasn't been materialized yet, it has a null for its 'curSharedRef' feature. Not sure if that's supposed to be the case or not. The gist of the problem here is that this is null so the EPS's hidePart(MPart) method thinks it's not a shared part and just toggles the TBR flag for the part instead of for the placeholder (the issue described in comment 4).

The workaround is to have the renderer flag the placeholder's TBR flag to 'false'.
Comment 6 Eric Moffatt CLA 2010-06-15 16:09:56 EDT
Created attachment 171986 [details]
Patch that sets the 'CurSharedRef' when creating the CTabItem


This fixes at least this particular defect and it makes sense in that the 'curSharedRef' is intended to always point to the placeholder currently representing the part.
Comment 7 Eric Moffatt CLA 2010-06-15 16:13:43 EDT
Committed in >20100615. Applied the patch (and removed the workaround code).
Comment 8 Remy Suen CLA 2010-06-18 11:59:12 EDT
*** Bug 314897 has been marked as a duplicate of this bug. ***
Comment 9 Eric Moffatt CLA 2010-06-21 13:06:42 EDT
Marking as FIXED. Feel free to re-open if you encounter any similar issues.