Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8114666

SortedList AIOOB replacing last element in wrapped list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx
    • 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

        There are no Sub-Tasks for this issue.

            msladecek Martin Sládeček
            duke J. Duke
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: