RFR: 8272992: Replace usages of Collections.sort with List.sort call in jdk.* modules

Paul Sandoz psandoz at openjdk.java.net
Mon Sep 13 17:34:01 UTC 2021


On Mon, 23 Aug 2021 21:08:05 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

> Collections.sort is just a wrapper, so it is better to use an instance method directly.

This looks a good change. Either as part of this PR or as a follow up I think it is worth reviewing the comparators passed to the sort method.

In some cases there is repetition and in other cases it may be possible to use `Comparator.comparing` or the primitive specialization.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5230


More information about the javadoc-dev mailing list