Skip to content

Commit

Permalink
Fix bug in requirement sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
merks committed Dec 17, 2023
1 parent 0549b90 commit 66317de
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public int compare(RequirementAnalysis ra1, RequirementAnalysis ra2) {
if (ra1 == null) {
return -1;
}
if (ra2 == null) {
return 1;
}
return REQUIREMENT_COMPARATOR.compare(ra1.getRequirement(), ra2.getRequirement());
}

Expand All @@ -69,6 +72,9 @@ public int compare(IRequirement r1, IRequirement r2) {
if (r1 == null) {
return -1;
}
if (r2 == null) {
return 1;
}

int compare;
if (r1 instanceof IRequiredCapability && r2 instanceof IRequiredCapability) {
Expand Down Expand Up @@ -101,7 +107,7 @@ public int compare(IRequirement r1, IRequirement r2) {
compare = pm1.toString().compareTo(pm2.toString());
}
} else {
compare = r1.getClass().getName().compareTo(r1.getClass().getName());
compare = r1.getClass().getName().compareTo(r2.getClass().getName());
}
}
return compare;
Expand Down

0 comments on commit 66317de

Please sign in to comment.