changeset 6411:7fac01b6f9b8

RT-36002: Defender method used in SelectedCellsMap Contributed-by: snorthov Reviewed-by: jgiles
author jgiles
date Tue, 25 Feb 2014 13:40:48 +1300
parents a5bf93565444
children ca9b98508292
files modules/controls/src/main/java/com/sun/javafx/scene/control/SelectedCellsMap.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/SelectedCellsMap.java	Mon Mar 03 15:05:41 2014 -0800
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/SelectedCellsMap.java	Tue Feb 25 13:40:48 2014 +1300
@@ -27,6 +27,7 @@
 import javafx.collections.FXCollections;
 import javafx.collections.ListChangeListener;
 import javafx.collections.ObservableList;
+import javafx.collections.transformation.SortedList;
 import javafx.scene.control.TablePositionBase;
 
 import java.util.*;
@@ -54,7 +55,7 @@
 
     public SelectedCellsMap(final ListChangeListener<T> listener) {
         selectedCells = FXCollections.<T>observableArrayList();
-        sortedSelectedCells = selectedCells.sorted(new Comparator<T>() {
+        sortedSelectedCells = new SortedList<>(selectedCells, new Comparator<T>() {
             @Override public int compare(T o1, T o2) {
                 return o1.getRow() - o2.getRow();
             }