Project: Eclipse_Platform_UI
Bug 192051 [StatusHandling] NPE in StatusNotificationManager
Reported: 2007-06-11 18:00:11 | Status: verified fixed

The following NPE occurred in StatusNotificationManager during a JUnit plugin test: Caused by: java.lang.NullPointerException at org.eclipse.ui.internal.statushandlers.StatusNotificationManager$3.run(StatusNotificationManager.java:134) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) The code in question is: Display.getDefault().asyncExec(new Runnable() { public void run() { dialog = new StatusDialog(ProgressManagerUtil .getDefaultParent(), statusInfo, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR, modal); dialog.open(); dialog.getShell().addDisposeListener(disposeListener); // <-- NPE HERE } }); ProgressManagerUtil.getDefaultParent() specifies that it can return null. If this happens, the call to dialog.getShell() will return null and this NPE will occur. This particular case probably occurred when this async runnable ran after the workbench had closed. (For reference, this bug was reported in Jazz defect #24058.)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusNotificationManager.java