Bug 130976 [Viewers] Error is calculation of parent path when calling TreePathViewerSorter
There is an error in the parent path calculation in AbstractTreeViewer#getSortedChildren. If the input of the viewer is passed, a tee path of length one is passed to the sorter but a null should be passed (as mentioned in the method spec). I will attach a patch.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
if (elementOrPath instanceof TreePath) {
			return ((TreePath)elementOrPath).getLastSegment();
		}
		return elementOrPath;
	}
    /**
	 * This method takes a tree path or an element. If the argument is not a
	 * tree path, returns the parent of the given element or <code>null</code>
	 * if the parent is not known. If the argument is a tree path with more than
	 * one segment, returns its parent tree path, otherwise returns
	 * <code>null</code>.
	 * 
	 * @param elementOrTreePath
	 * @return the parent element, or parent path, or <code>null</code>
	 * 
	 * @since 3.2
	 */ 
    protected Object getParentElement(Object elementOrTreePath) {
    	if(elementOrTreePath instanceof TreePath) {
    		TreePath treePath = (TreePath)elementOrTreePath;
    		if(treePath.getSegmentCount() <= 1) {
    			return null;
    		}
			return (treePath).getParentPath();
    	}
        IContentProvider cp = getContentProvider();
        if (cp instanceof ITreePathContentProvider) {
			ITreePathContentProvider tpcp = (ITreePathContentProvider) cp;
			TreePath[] paths = tpcp.getParents(elementOrTreePath);
			if (paths.length > 0) {