-
Bug
-
Resolution: Fixed
-
P4
-
fx2.0
-
javafx-2_0-beta-b32
Replacing the last element (which sorting has changed) of an ObservableList wrapped by a SortedList gives an exception (see attached file for test case):
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at javafx.collections.SortedList.removeSorted(SortedList.java:119)
at javafx.collections.SortedList.onSourceChanged(SortedList.java:248)
at javafx.collections.TransformationList$1.onChanged(TransformationList.java:83)
at com.sun.javafx.collections.ObservableListWrapper.callObservers(ObservableListWrapper.java:62)
at com.sun.javafx.collections.ObservableListWrapper.set(ObservableListWrapper.java:196)
at deepobservable.TestSortedList.main(TestSortedList.java:37)
The reason to replace the element with itself is to trigger the resort. See also http://forums.oracle.com/forums/thread.jspa?messageID=9692547#9692547
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at javafx.collections.SortedList.removeSorted(SortedList.java:119)
at javafx.collections.SortedList.onSourceChanged(SortedList.java:248)
at javafx.collections.TransformationList$1.onChanged(TransformationList.java:83)
at com.sun.javafx.collections.ObservableListWrapper.callObservers(ObservableListWrapper.java:62)
at com.sun.javafx.collections.ObservableListWrapper.set(ObservableListWrapper.java:196)
at deepobservable.TestSortedList.main(TestSortedList.java:37)
The reason to replace the element with itself is to trigger the resort. See also http://forums.oracle.com/forums/thread.jspa?messageID=9692547#9692547
- relates to
-
JDK-8112763 SortedList: getSourceIndex invalid during removal
- Resolved
-
JDK-8101447 Provide ObservableList implementation that copes with mutable elements
- Closed