defender method used in SelectedCellsMap

Stephen F Northover steve.x.northover at oracle.com
Fri Feb 21 09:42:51 PST 2014


Please enter a JIRA.  In the meantime, try this patch:

Steve

diff --git 
a/modules/controls/src/main/java/com/sun/javafx/scene/control/SelectedCellsMap.java 
b/modules/controls/src/main/java/com/sun/javafx/scene/control/SelectedCellsMap.java
--- 
a/modules/controls/src/main/java/com/sun/javafx/scene/control/SelectedCellsMap.java
+++ 
b/modules/controls/src/main/java/com/sun/javafx/scene/control/SelectedCellsMap.java
@@ -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();
              }

On 2014-02-21 7:14 AM, Johan Vos wrote:
> At this moment, I'm compiling all files (java and native) targeting dalvik,
> apart from 1:
>
> com.sun.javafx.scene.control.SelectedCellsMap uses
> ObservableList.sorted(...)
>
>
> What is the best approach here?
>
> - Johan



More information about the openjfx-dev mailing list