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/dialogs/ErrorDialog.java
status, displayMask);
		return dialog.open();
	}
	/**
	 * Populates the list using this error dialog's status object. This walks
	 * the child static of the status object and displays them in a list. The
	 * format for each entry is status_path : status_message If the status's
	 * path was null then it (and the colon) are omitted.
	 * @param listToPopulate The list to fill.
	 */
	private void populateList(List listToPopulate) {
		Iterator enum = statusList.iterator();
		while (enum.hasNext()) {
			IStatus childStatus = (IStatus) enum.next();
			populateList(listToPopulate, childStatus, 0);
		}
	}
	private void populateList(List listToPopulate, IStatus buildingStatus, int nesting) {
		if (!buildingStatus.matches(displayMask)) {
			return;
		}
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < nesting; i++) {
			sb.append(NESTING_INDENT); 
		}
		sb.append(buildingStatus.getMessage());
		listToPopulate.add(sb.toString());
		IStatus[] children = buildingStatus.getChildren();
		for (int i = 0; i < children.length; i++) {
			populateList(listToPopulate, children[i], nesting + 1);