diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java index e45b53ea6..902357060 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java @@ -366,12 +366,8 @@ class PackedBatchRefUpdate extends BatchRefUpdate { List commands) throws IOException { // Construct a new RefList by merging the old list with the updates. // This assumes that each ref occurs at most once as a ReceiveCommand. - Collections.sort(commands, new Comparator() { - @Override - public int compare(ReceiveCommand a, ReceiveCommand b) { - return a.getRefName().compareTo(b.getRefName()); - } - }); + Collections.sort(commands, + Comparator.comparing(ReceiveCommand::getRefName)); int delta = 0; for (ReceiveCommand c : commands) {