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/AbstractTreeViewer.java
* @param level non-negative level, or <code>ALL_LEVELS</code> to expand
 *  all levels of the tree
 */
public void expandToLevel(Object element, int level) {
	Widget w = internalExpand(element, true);
	if (w != null)
		internalExpandToLevel(w, level);
}
/**
 * Fires a tree collapsed event.
 * Only listeners registered at the time this method is called are notified.
 *
 * @param event the tree expansion event
 *
 * @see ITreeViewerListener#treeCollapsed
 */
protected void fireTreeCollapsed(TreeExpansionEvent event) {
	Object[] listeners = treeListeners.getListeners();
	for (int i = 0; i < listeners.length; ++i) {
		((ITreeViewerListener) listeners[i]).treeCollapsed(event);
	}
}
/**
 * Fires a tree expanded event.
 * Only listeners registered at the time this method is called are notified.
 *
 * @param event the tree expansion event
 *
 * @see ITreeViewerListener#treeExpanded
 */