Bug 14411 Method sorting should put methods with less parameters first
Build 20020418 If you define the following cu: public class X { public void foo(String) { } public void foo(String, String) { } } and you choose to sort in the Outline, you get the following order: X +- foo(String, String) +- foo(String) I would expect to have: X +- foo(String) +- foo(String, String)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementSorter.java
private int compareWithLabelProvider(Viewer viewer, Object e1, Object e2) {
		if (viewer == null || !(viewer instanceof ContentViewer)) {
			IBaseLabelProvider prov = ((ContentViewer) viewer).getLabelProvider();
			if (prov instanceof ILabelProvider) {
				ILabelProvider lprov= (ILabelProvider) prov;
				String name1 = lprov.getText(e1);
				String name2 = lprov.getText(e2);
				if (name1 != null && name2 != null) {
					return getCollator().compare(name1, name2);
				}
			}
		}
		return 0; 
	}
			
	private int getClassPathIndex(IPackageFragmentRoot root) {
		try {
			IPath rootPath= root.getPath();
			IPackageFragmentRoot[] roots= root.getJavaProject().getPackageFragmentRoots();
			for (int i= 0; i < roots.length; i++) {
				if (roots[i].getPath().equals(rootPath)) {
					return i;
				}
			}
		} catch (JavaModelException e) {
		}
		return Integer.MAX_VALUE;
	}	
}