Bug 15844 [Exception Handling] SelectionChange events and NPE
Build 20020508 Due to new global actions there are now more objects listening to selection changes send out by a JFace viewer. We now had the case that one of the listener generated a NPE. As a result all listeners registered after that one didn't receive the selection change event. StructuredViewers should be more fault tolorant to exceptions when informing listeners.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
* Subclasses do not typically override this method, but implement <code>setSelectionToWidget(List, boolean)</code> instead.
 *
 * @param selection an IStructuredSelection of elements
 * @param reveal <code>true</code> to reveal the first element in the selection, or <code>false</code> otherwise
 */
protected void setSelectionToWidget(ISelection selection, boolean reveal) {
	if (selection instanceof IStructuredSelection)
		setSelectionToWidget(((IStructuredSelection) selection).toList(), reveal);
	else
		setSelectionToWidget((List) null, reveal);
}
/**
 * Sets this viewer's sorter and triggers refiltering and resorting
 * of this viewer's element. Passing <code>null</code> turns sorting off.
 *
 * @param sorter a viewer sorter, or <code>null</code> if none
 */
public void setSorter(ViewerSorter sorter) {
	if (this.sorter != sorter) {
		this.sorter = sorter;
		refresh();
	}
}
/**
 * Configures whether this structured viewer uses an internal hash table to
 * speeds up the mapping between elements and SWT items.
 * This must be called before the viewer is given an input (via <code>setInput</code>).
 *
 * @param enable <code>true</code> to enable hash lookup, and <code>false</code> to disable it
 */