Skip to content

Commit

Permalink
desc sort order when merge list (#27190)
Browse files Browse the repository at this point in the history
* #25729 adding test and removing unnecessary sort

* #25729 adding desc order to list

* #25729 feedback

* #25729 adding final

---------

Co-authored-by: erickgonzalez <erick.gonzalez@dotcms.com>
  • Loading branch information
AndreyDotcms and erickgonzalez committed Jan 8, 2024
1 parent 379ece3 commit e36d2a7
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -4026,7 +4026,11 @@ public List<WorkflowTimelineItem> getCommentsAndChangeHistory(final WorkflowTask
CollectionsUtils.join(this.findWorkFlowComments(task),
this.findWorkflowHistory (task));

return workflowTimelineItems.stream().collect(CollectionsUtils.toImmutableList());
final Comparator<WorkflowTimelineItem> comparator = Comparator.comparing(WorkflowTimelineItem::createdDate).reversed();
return workflowTimelineItems.stream()
.sorted(comparator)
.collect(CollectionsUtils.toImmutableList());

}


Expand Down

0 comments on commit e36d2a7

Please sign in to comment.