Project: Eclipse_Platform_UI
Bug 346753 PartFocusTest tear down sometimes throws NPE
Reported: 2011-05-20 14:16:54 | Status: resolved fixed

It seems like the disposal of a widget is causing SWT.Activate to be sent to a stack that's been unhooked from its model element. java.lang.NullPointerException at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.activateStack(StackRenderer.java:164) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$5(StackRenderer.java:163) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$7.handleEvent(StackRenderer.java:616) 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:1058) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1446) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2823) at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2403) at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:5135) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4581) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4983) at org.eclipse.swt.internal.win32.OS.DestroyWindow(Native Method) at org.eclipse.swt.widgets.Control.destroyWidget(Control.java:771) at org.eclipse.swt.widgets.Widget.release(Widget.java:818) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:446) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$3.widgetDisposed(StackRenderer.java:364) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:123) 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.notifyListeners(Widget.java:774) at org.eclipse.e4.ui.widgets.CTabFolder.onDispose(CTabFolder.java:1512) at org.eclipse.e4.ui.widgets.CTabFolder$1.handleEvent(CTabFolder.java:264) 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:1058) at org.eclipse.swt.widgets.Widget.release(Widget.java:808) at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:873) at org.eclipse.swt.widgets.Widget.release(Widget.java:811) at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:873) at org.eclipse.swt.widgets.Widget.release(Widget.java:811) at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:873) at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:167) at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:773) at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1289) at org.eclipse.swt.widgets.Widget.release(Widget.java:811) at org.eclipse.swt.widgets.Widget.dispose(Widget.java:446) at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:447) at org.eclipse.swt.widgets.Shell.dispose(Shell.java:715) at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:309) at org.eclipse.swt.widgets.Shell.close(Shell.java:538) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.stop(PartRenderingEngine.java:1014) at org.eclipse.e4.ui.internal.workbench.E4Workbench.close(E4Workbench.java:124) at org.eclipse.e4.ui.tests.workbench.PartFocusTest.tearDown(PartFocusTest.java:131)

Files changed in fix:
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java