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

Bug 409746

Summary: ISE in ContributedPartRenderer$2.setFocus
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, daniel_megert, emoffatt, lneumeier, markus.kell.r, Mike_Wilson, pwebster, Udo.Walker
Version: 4.3Flags: Mike_Wilson: pmc_approved+
emoffatt: review+
markus.kell.r: review+
Target Milestone: 4.3 RC4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 409324, 414048    
Bug Blocks:    

Description Paul Webster CLA 2013-06-03 11:25:44 EDT
+++ This bug was initially created as a clone of Bug #409324 +++

4.3.0.I20130526-2000

I sometimes get the ISE below when I switch between open editor tabs using the mouse. It doesn't happen all the time, but once it started, it usually continues to happen with every further click.

I haven't seen this before the I20130526-2000 build.

Warning
Tue May 28 20:08:52 CEST 2013
Blocked recursive attempt to activate part

java.lang.IllegalStateException
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:119)
	at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:329)
	at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2509)
	at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1053)
	at org.eclipse.swt.widgets.Control.setVisible(Control.java:3819)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3049)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3006)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1101)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:66)
	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:4688)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:205)
	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:80)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:576)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:543)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:605)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:585)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.setPart(PartServiceImpl.java:158)
	at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:88)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:107)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:328)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:342)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:625)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:630)
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.activate(PartActivationHistory.java:52)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:588)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:539)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:104)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:59)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1453)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1416)
	at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2856)
	at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2421)
	at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:5235)
	at org.eclipse.swt.widgets.Canvas.WM_SETFOCUS(Canvas.java:457)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4681)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977)
	at org.eclipse.swt.internal.win32.OS.$$YJP$$CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(OS.java)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2443)
	at org.eclipse.swt.internal.BidiUtil.windowProc(BidiUtil.java:639)
	at org.eclipse.swt.internal.win32.OS.$$YJP$$SetFocus(Native Method)
	at org.eclipse.swt.internal.win32.OS.SetFocus(OS.java)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:1098)
	at org.eclipse.swt.widgets.Control.setFocus(Control.java:3323)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1042)
	at org.eclipse.ui.texteditor.AbstractTextEditor.setFocus(AbstractTextEditor.java:6213)
	at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:122)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2389)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:192)
	at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:243)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:249)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:220)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:763)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:102)
	at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:329)
	at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2509)
	at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1053)
	at org.eclipse.swt.widgets.Control.setVisible(Control.java:3819)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3049)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3057)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1753)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:278)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Comment 1 Paul Webster CLA 2013-06-03 11:33:29 EDT
Fix for RC4:  Remove the logging.  We already have recursive protection code that works, and they views and editors behave correctly, so the risk of this change is minimal.  This logging doesn't do more than fill up the logs.

https://git.eclipse.org/r/13508

PW
Comment 2 Paul Webster CLA 2013-06-03 11:36:04 EDT
+1 for me for RC4.  Dani, I need another component lead +1.  Would you consider this for RC4?

PW
Comment 3 Dani Megert CLA 2013-06-03 11:42:47 EDT
(In reply to comment #2)
> +1 for me for RC4.  Dani, I need another component lead +1.  Would you
> consider this for RC4?
> 
> PW

+1 to remove it for RC4. We already got the warning in other scenarios in 3.x and they did not help to find and fix the issues. If we bring it back in 4.4, then we should log more details, so that we can figure out what's happening.
Comment 4 Markus Keller CLA 2013-06-03 12:14:38 EDT
(In reply to comment #1)
+1 for RC4. This looks like the safest fix at this point. The field "logger" is unused after this change, but the "@Optional" currently stops the compiler from issuing an error for that situation (bug 376590 comment 10).
Comment 5 Markus Keller CLA 2013-06-03 12:17:33 EDT
*** Bug 408810 has been marked as a duplicate of this bug. ***
Comment 6 Eric Moffatt CLA 2013-06-03 13:08:01 EDT
+1 A quick check shows that we don't get the ISE's anymore and I don't see any obvious regressions...
Comment 8 Dani Megert CLA 2013-06-04 03:32:30 EDT
Verified in I20130603-2000.

NOTE: The bug number in the commit message is wrong (points to the 4.3.1 bug).
Comment 9 Dani Megert CLA 2013-08-19 06:50:59 EDT
*** Bug 415326 has been marked as a duplicate of this bug. ***