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
for (Iterator e = table.values().iterator(); e.hasNext();) {
			Entry entry = (Entry) e.next();
			if (entry.image != null) {
				entry.image.dispose();
			}
		}
		table = null;
	}
	/**
	 * Hook a dispose listener on the SWT display.
	 *
	 * @param display the Display
	 */
	private void hookDisplayDispose(Display display) {
		display.disposeExec(new Runnable() {
			public void run() {
				handleDisplayDispose();
			}
		});
	}
	/**
	 * Adds (or replaces) an image descriptor to this registry. The first time
	 * this new entry is retrieved, the image descriptor's image will be computed 
	 * (via </code>ImageDescriptor.createImage</code>) and remembered. 
	 * This method replaces an existing image descriptor associated with the 
	 * given key, but fails if there is a real image associated with it.
	 *
	 * @param key the key
	 * @param descriptor the ImageDescriptor
	 * @exception IllegalArgumentException if the key already exists