JBTable: use a singleton list
authorSergey Savenko <sergey.savenko@jetbrains.com>
Wed, 18 Feb 2015 16:04:29 +0000 (19:04 +0300)
committerSergey Savenko <sergey.savenko@jetbrains.com>
Wed, 18 Feb 2015 17:38:41 +0000 (20:38 +0300)
platform/platform-api/src/com/intellij/ui/table/JBTable.java

index 0c8cb2818ab736632656dafabc7a182c163f68c6..2d86e10c244e6d21b230bfa2ca49342d55ee7017 100644 (file)
@@ -38,6 +38,7 @@ import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.EventObject;
 
@@ -216,7 +217,7 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
         final RowSorter.SortKey sortKey = sortableModel.getDefaultSortKey();
         if (sortKey != null && sortKey.getColumn() >= 0 && sortKey.getColumn() < model.getColumnCount()) {
           if (sortableModel.getColumnInfos()[sortKey.getColumn()].isSortable()) {
-            rowSorter.setSortKeys(Arrays.asList(sortKey));
+            rowSorter.setSortKeys(Collections.singletonList(sortKey));
           }
         }
       }