gerrit/gerrit-gwtui/src/main/java/net/codemirror/mode
Dave Borowitz 6724990a32 Avoid Collections#sort
With the introduction of default methods in Java 8, Java finally grew a
List#sort method that can be used in place of the static
Collections#sort. Convert simple in-place sorts that need to be in-place
sorts to use this method where possible.

During the course of this change, it became obvious that many instances
of sort were just sorting a newly-created ArrayList in place. These can
be replaced with more idiomatic Stream constructions, sometimes even
eliminating a loop to populate the list.

One difference between List#sort and Collections#sort is there is no
List#sort() with no arguments; callers must always pass either
naturalOrder() or a null comparators. In this change, there were so few
remaining instances of sorting by natural order that typing
naturalOrder() didn't seem too repetitious, and it is quite readable.

Change-Id: I4d89421a72127e9a36cbd32aeac425c0471a1b3f
2018-09-05 09:53:01 -07:00
..
gerrit Match hex digits as a SHA-1 only at word boundaries 2014-12-30 17:50:05 +00:00
ModeInfo.java Avoid Collections#sort 2018-09-05 09:53:01 -07:00
ModeInjector.java Remove 'final' from method signatures across gerrit. 2017-06-14 09:18:42 +02:00
Modes.java Format all Java files with google-java-format 2017-02-07 10:04:39 +09:00