GT-2961 - CategoryPath revert change and supply fix.

This commit is contained in:
ghizard 2019-07-09 18:44:21 -04:00
parent f62b220e09
commit 860fe5a2d7

View file

@ -288,17 +288,15 @@ public class CategoryPath implements Comparable<CategoryPath> {
*/
@Override
public int compareTo(CategoryPath other) {
CategoryPath otherParent = other.getParent();
if (parent == null) {
if (otherParent != null) {
return -1;
}
}
else if (otherParent == null) {
return 1;
if (isRoot() && other.isRoot()) {
return 0;
}
int result = parent.compareTo(otherParent);
if (isRoot() || other.isRoot()) {
return isRoot() ? -1 : 1;
}
int result = parent.compareTo(other.getParent());
if (result == 0) {
result = name.compareTo(other.getName());