Skip to content

Commit

Permalink
get latest should be last not first element (#584)
Browse files Browse the repository at this point in the history
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Adam Stevenson <[email protected]>
  • Loading branch information
3 people authored Nov 18, 2024
1 parent b578062 commit 12f0c5f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static Optional<IDomainResource> findLatestVersion(IBaseBundle bundle) {
.sorted((a, b) -> Versions.compareVersions(a.getVersion(), b.getVersion()))
.collect(Collectors.toList());
if (!sorted.isEmpty()) {
return Optional.of(sorted.get(0).get());
return Optional.of(sorted.get(sorted.size() - 1).get());
} else {
return Optional.ofNullable(null);
}
Expand Down

0 comments on commit 12f0c5f

Please sign in to comment.