Project: SWT
Bug 38161 MessageDialog does not accept null shell
Reported: 2003-05-27 12:52:26 | Status: resolved wontfix

2.1 The Javadoc for MessageDialog's constructors states: Note: Currently, null can be passed in for the parent. ... However, this is no longer the case. In 2.1, trying this results in an NPE. I actually wanted this since I need to bring up a dialog on startup to notify the user of a workspace version incompatibility. There are no other shells around at this point (or even a display). Now I have to create a bogus shell just to avoid the NPE.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Dialog.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ColorDialog.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FontDialog.java bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java