Skip to content

Commit

Permalink
bugfix: corrected implementation of interface method compareTo
Browse files Browse the repository at this point in the history
  • Loading branch information
ffritze committed Aug 6, 2024
1 parent f093280 commit bb1a554
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetFieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,15 @@ public void setDatasetFieldDefaultValues(List<DatasetFieldDefaultValue> datasetF

@Override
public int compareTo(DatasetFieldType o) {
return Integer.compare(this.getDisplayOrder(), (o.getDisplayOrder()));
if (this.getDisplayOrder() < o.getDisplayOrder()) {
return -1;
}
if (this.getDisplayOrder() == o.getDisplayOrder()) {
return 0;
}
else {
return 1;
}
}

public String getDisplayName() {
Expand Down

0 comments on commit bb1a554

Please sign in to comment.