Project: SWT
Bug 276569 Cocoa: exception gets logged when opening views while a detached view exists
Reported: 2009-05-15 17:04:10 | Status: resolved fixed

I am seeing a lot of logged exceptions, and it seems to be caused by the fact that I have a detached (torn off) view. I am out of time to boil this down to reproducible steps, but it should be reproducible as follows: 1. Reset Java perspective. 2. Tear off Package Explorer. 3. Open views and editors in various configurations. 4. Check the error log view regularly. Here is an example stack trace: java.lang.RuntimeException: WARNING: Prevented recursive attempt to activate part org.eclipse.debug.ui.BreakpointView while still in the middle of activating part org.eclipse.team.ui.GenericHistoryView at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3481) at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3071) at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279) at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:237) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3539) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1246) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1269) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1228) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2887) at org.eclipse.swt.widgets.Display.checkFocus(Display.java:575) at org.eclipse.swt.widgets.Shell.becomeKeyWindow(Shell.java:467) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4533) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSWindow.makeKeyAndOrderFront(NSWindow.java:175) at org.eclipse.swt.widgets.Shell.makeKeyAndOrderFront(Shell.java:1017) at org.eclipse.swt.widgets.Shell.setActive(Shell.java:1193) at org.eclipse.swt.widgets.Shell.bringToTop(Shell.java:476) at org.eclipse.swt.widgets.Control.forceFocus(Control.java:1249) at org.eclipse.swt.widgets.Control.setFocus(Control.java:3232) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:853) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:851) at org.eclipse.team.internal.ui.history.LocalHistoryPage.setFocus(LocalHistoryPage.java:531) at org.eclipse.team.internal.ui.history.GenericHistoryView.setFocus(GenericHistoryView.java:612) at org.eclipse.ui.internal.PartPane.setFocus(PartPane.java:332) at org.eclipse.ui.internal.WorkbenchPage$3.run(WorkbenchPage.java:626) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.runtime.Platform.run(Platform.java:888) at org.eclipse.ui.internal.WorkbenchPage.activatePart(WorkbenchPage.java:621) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3527) at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:614) at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1092) at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1069) at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.java:3816) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3813) at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3789) at org.eclipse.ui.internal.quickaccess.ViewElement.execute(ViewElement.java:38) at org.eclipse.ui.internal.quickaccess.QuickAccessDialog.handleElementSelected(QuickAccessDialog.java:681) at org.eclipse.ui.internal.quickaccess.QuickAccessDialog.handleSelection(QuickAccessDialog.java:758) at org.eclipse.ui.internal.quickaccess.QuickAccessDialog.access$6(QuickAccessDialog.java:748) at org.eclipse.ui.internal.quickaccess.QuickAccessDialog$3.keyPressed(QuickAccessDialog.java:177) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:155) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3539) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1246) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1269) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1254) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1283) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1279) at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1371) at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:909) at org.eclipse.swt.widgets.Display.fieldEditorProc(Display.java:4444) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:201) at org.eclipse.swt.widgets.Widget.superKeyDown(Widget.java:1624) at org.eclipse.swt.widgets.Widget.keyDown(Widget.java:908) at org.eclipse.swt.widgets.Control.keyDown(Control.java:2029) at org.eclipse.swt.widgets.Display.fieldEditorProc(Display.java:4436) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:201) at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1742) at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:1814) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4697) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4269) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4336) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:101) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3093) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) 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:368) 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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java