Skip to content

Commit

Permalink
fix MarkerPriorityField.compare() #2041
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T committed Jul 9, 2024
1 parent 47d6592 commit 9f79cc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,16 @@ public int compare(MarkerItem item1, MarkerItem item2) {
* @return int
*/
public int compareFields(MarkerItem item0, MarkerItem item1) {
int value = 0;
for (MarkerField field : fields) {
value = field.compare(item0, item1);
int value = field.compare(item0, item1);
if (value != 0) {
if (descendingFields.contains(field)) {
value = -value;
}
break;
return value;
}
}
return value;
return 0;
}
/**
* Comparator to compare the two MarkerEntry(s) by various fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public MarkerPriorityField() {
@Override
public int compare(MarkerItem item1, MarkerItem item2) {
return Integer.compare(item1.getAttributeValue(IMarker.PRIORITY, IMarker.PRIORITY_NORMAL),
item1.getAttributeValue(IMarker.PRIORITY, IMarker.PRIORITY_NORMAL));
item2.getAttributeValue(IMarker.PRIORITY, IMarker.PRIORITY_NORMAL));
}

@Override
Expand Down

0 comments on commit 9f79cc0

Please sign in to comment.