Bug 28267 55% of open type hiearchy spent in sorting [type hierarchy]
20021210+latest 1213 junit workspace typehierarchy on Object 55% is spent in sorting
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/JavaElementAdapterFactory.java
/*
    	 * Map a type to the corresponding CU.
    	 */
    	if (element instanceof IType) {
    		IType type= (IType)element;
    		IJavaElement parent= type.getParent();
    		if (parent instanceof ICompilationUnit) {
    			ICompilationUnit cu= (ICompilationUnit)parent;
    			if (cu.isWorkingCopy())
    				element= cu.getOriginalElement();
    			else 
    				element= cu;
    		}
    	}
    	try {
    		return element.getCorrespondingResource();
    	} catch (JavaModelException e) {
    		if (element instanceof ICompilationUnit)
    			return element.getResource(); 
    		else	
    			return null;	
    	}
    }
    /*
     * @see org.eclipse.ui.IContributorResourceAdapter#getAdaptedResource(org.eclipse.core.runtime.IAdaptable)
     */
    public IResource getAdaptedResource(IAdaptable adaptable) {
        return getResource((IJavaElement)adaptable);
    }