defender method used in SelectedCellsMap

Jonathan Giles jonathan.giles at oracle.com
Mon Feb 24 16:42:25 PST 2014


I've tested this patch and can not see any issues (and all unit tests
previously written for this code continue to pass). I've filed RT-36002
[1], and will push this to the 8u20 repo today.

[1] https://javafx-jira.kenai.com/browse/RT-36002

-- Jonathan

On 22/02/2014 6:42 a.m., Stephen F Northover wrote:
> 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