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
* Returns the parent item of the given item in the tree, or
 * <code>null</code> if there is parent item.
 *
 * @param item the item
 * @return the parent item, or <code>null</code> if none
 */
protected abstract Item getParentItem(Item item);
/**
 * Returns the item before the given item in the tree, or
 * <code>null</code> if there is no previous item.
 *
 * @param item the item
 * @return the previous item, or <code>null</code> if none
 */
protected Item getPreviousItem(Item item) {
	 
	
	Item parent = getParentItem(item);
	if (parent == null) {
		return null;
	}
	Item[] siblings = getItems(parent);
	if (siblings.length == 0 || siblings[0] == item) {
		return parent;
	}
	Item previous = siblings[0];
	for (int i = 1; i < siblings.length; i++) {
		if (siblings[i] == item) {
			return rightMostVisibleDescendent(previous);
		}