in src/main/java/org/apache/sling/auth/core/impl/PathBasedHolder.java [193:217]
public int compareTo(PathBasedHolder other) {
// compare the path first, and return if not equal
final int pathResult = other.path.compareTo(path);
if (pathResult != 0) {
return pathResult;
}
// now compare the service references giving priority to
// to the higher priority service
if (serviceReference == null) {
if (other.serviceReference == null) {
return this.getClass().getName().compareTo(other.getClass().getName());
}
return -1;
} else if (other.serviceReference == null) {
return 1;
}
final int serviceResult = other.serviceReference.compareTo(serviceReference);
if (serviceResult != 0) {
return serviceResult;
}
return this.getClass().getName().compareTo(other.getClass().getName());
}