Bug 32943 Hierarchy view should better group types with locked methods [type hierarchy]
Build RC1 When locking on a given method, occurrences of such a method are always listed behind subtypes, which is causing the end result to be quite hard to decode: Instead of: A +- foo() +- B +- foo() +- C +- foo() It currently displays: A +- B | +- C | | +- foo() | +- foo() +- foo() which goes backwards, when multiple sibling subtypes exist, the end result is even worse.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/HierarchyViewerSorter.java
} catch (JavaModelException e) {
				
			}
		}
		return super.compare(viewer, e1, e2);
	}
	
	private IType getDefiningType(ITypeHierarchy hierarchy, IMethod method) throws JavaModelException {
		IType declaringType= (IType) JavaModelUtil.toOriginal(method.getDeclaringType());
		int flags= method.getFlags();
		if (Flags.isPrivate(flags) || Flags.isStatic(flags) || method.isConstructor()) {
			return null;
		}
	
		IMethod res= JavaModelUtil.findMethodDeclarationInHierarchy(hierarchy, declaringType, method.getElementName(), method.getParameterTypes(), false);
		if (res == null || method.equals(res)) {
			return null;
		}
		return res.getDeclaringType();
	}
	
	private int compareInHierarchy(ITypeHierarchy hierarchy, IType def1, IType def2) {
		if (isSuperType(hierarchy, def1, def2)) {
			return 1;
		} else if (isSuperType(hierarchy, def2, def1)) {
			return -1;
		}
		
		int flags1= hierarchy.getCachedFlags(def1);
		int flags2= hierarchy.getCachedFlags(def2);