*/
private static final class ClassInstanceComparator implements Comparator<ClassInstance> {
/** {@inheritDoc} */
public int compare(ClassInstance a, ClassInstance b) {
QualifiedName aTypeClassName = a.getTypeClass().getName();
QualifiedName bTypeClassName = b.getTypeClass().getName();
/// first compare the type classes' names in a case-insensitive manner
//
int typeClassUnqualifiedNameComparison = aTypeClassName.getUnqualifiedName().compareTo(bTypeClassName.getUnqualifiedName());
if (typeClassUnqualifiedNameComparison != 0) {
return typeClassUnqualifiedNameComparison;
} else {
/// then comparse the type classes' names in a case-sensitive manner
//
int typeClassModuleNameComparison = aTypeClassName.getModuleName().compareTo(bTypeClassName.getModuleName());
if (typeClassModuleNameComparison != 0) {
return typeClassModuleNameComparison;
} else {
/// the type classes' are in fact the same, so compare the instance type: