Collator collator= getCollator(); String name1; String name2; switch (cat1) { case OTHERS: return 0; case RESOURCES: case RESOURCEFOLDERS: name1= ((IResource) e1).getName(); name2= ((IResource) e2).getName(); break; case STORAGE: name1= ((IStorage) e1).getName(); name2= ((IStorage) e2).getName(); break; default: name1= JavaElementLabels.getElementLabel((IJavaElement) e1, JavaElementLabels.M_PARAMETER_TYPES); name2= JavaElementLabels.getElementLabel((IJavaElement) e2, JavaElementLabels.M_PARAMETER_TYPES); break;
if (cat1 == STORAGE) { return getCollator().compare(((IStorage) e1).getName(),  ((IStorage) e2).getName());
	public int compare(Viewer viewer, Object e1, Object e2) {		int cat1= category(e1);		int cat2= category(e2);		if (cat1 != cat2)			return cat1 - cat2;					if (cat1 == PACKAGEFRAGMENTROOTS) {			int p1= getClassPathIndex(JavaModelUtil.getPackageFragmentRoot((IJavaElement)e1));			int p2= getClassPathIndex(JavaModelUtil.getPackageFragmentRoot((IJavaElement)e2));			if (p1 != p2) {				return p1 - p2;			}		}				Collator collator= getCollator();		String name1;		String name2;		switch (cat1) {			case OTHERS:				return 0;			case RESOURCES:			case RESOURCEFOLDERS:				name1= ((IResource) e1).getName();				name2= ((IResource) e2).getName();				break;			case STORAGE:				name1= ((IStorage) e1).getName();				name2= ((IStorage) e2).getName();				break;			default:				name1= JavaElementLabels.getElementLabel((IJavaElement) e1, JavaElementLabels.M_PARAMETER_TYPES);				name2= JavaElementLabels.getElementLabel((IJavaElement) e2, JavaElementLabels.M_PARAMETER_TYPES);				break;		}				return collator.compare(name1, name2);	}