gerrit/gerrit-gwtui/src/main/java/net/codemirror
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
..
addon Remove 'final' from method signatures across gerrit. 2017-06-14 09:18:42 +02:00
lib Remove 'final' from method signatures across gerrit. 2017-06-14 09:18:42 +02:00
mode Avoid Collections#sort 2018-09-05 09:53:01 -07:00
theme Remove 'final' from method signatures across gerrit. 2017-06-14 09:18:42 +02:00
CodeMirror.gwt.xml Dynamically load CodeMirror themes 2015-01-05 10:38:15 -08:00