Skip to content

Commit

Permalink
ordered revision in reverse.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsilaghi committed Sep 23, 2024
1 parent 4f1df51 commit 020290f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Optional<EntityPostCoordinationHistory> getExistingHistoryOrderedByRevisi
.map(history -> {
List<PostCoordinationRevision> sortedRevisions = history.getPostCoordinationRevisions()
.stream()
.sorted(Comparator.comparingLong(PostCoordinationRevision::timestamp))
.sorted(Comparator.comparingLong(PostCoordinationRevision::timestamp).reversed())
.collect(Collectors.toList());
// Return a new EntityLinearizationHistory object with the sorted revisions
return new EntityPostCoordinationHistory(history.getWhoficEntityIri(), history.getProjectId(), sortedRevisions);
Expand All @@ -85,7 +85,7 @@ public Optional<EntityCustomScalesValuesHistory> getExistingCustomScaleHistoryOr
).map(history -> {
List<PostCoordinationCustomScalesRevision> sortedRevisions = history.getPostCoordinationCustomScalesRevisions()
.stream()
.sorted(Comparator.comparingLong(PostCoordinationCustomScalesRevision::timestamp))
.sorted(Comparator.comparingLong(PostCoordinationCustomScalesRevision::timestamp).reversed())
.collect(Collectors.toList());
return new EntityCustomScalesValuesHistory(history.getWhoficEntityIri(), history.getProjectId(), sortedRevisions);
});
Expand Down

0 comments on commit 020290f

Please sign in to comment.