SortedList AIOOB replacing last element in wrapped list

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • fx2.0
    • Affects Version/s: fx2.0
    • Component/s: javafx
    • Environment:

      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

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

              Created:
              Updated:
              Resolved:
              Imported: