Bug 61743 NPE in MessageDialog with null parent shell
I-build 2004-05-11 I have code that does the following: MessageDialog.openInformation(null, "Showing element", "Showning an integer of value: "+((Integer)match.getElement()).intValue()); This leads to a null pointer with the follwing stack trace: Thread [main] (Suspended (exception NullPointerException)) MessageDialog.<init>(Shell, String, Image, String, int, String[], int) line: 126 MessageDialog.openInformation(Shell, String, String) line: 305 TestUIParticipant.showMatch(Match, int, int, boolean) line: 57 JavaSearchResultPage.showMatch(Match, int, int, boolean) line: 153 AbstractTextSearchViewPage$9.run() line: 723 <snip> The API doc for MessageDialog say that I'm allowed to pass in null for the parent shell.
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageRegistry.java
*/
		int swtKey = -1;
		if (key.equals(Dialog.DLG_IMG_INFO)) {
			swtKey = SWT.ICON_INFORMATION;			
		}
		if (key.equals(Dialog.DLG_IMG_QUESTION)) {
			swtKey = SWT.ICON_QUESTION;
		}
		if (key.equals(Dialog.DLG_IMG_WARNING)) {
			swtKey = SWT.ICON_WARNING;
		}
		if (key.equals(Dialog.DLG_IMG_ERROR)) {
				swtKey = SWT.ICON_ERROR;
		}
		
		
		if (swtKey != -1){
			final Display d = (display == null) ? Display.getCurrent() : display;
			final Image[] image = new Image[1];
			d.syncExec(new Runnable() {
				public void run() {
					image[0] = d.getSystemImage(SWT.ICON_INFORMATION);
				}
			});
			return image[0];
		}
		
		Entry entry = getEntry(key);
		if (entry == null) {
			return null;