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

ArrayIndexOutOfBoundsException in SortedList after removing an item

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Environment:

      Windows 7 64-bit
      Java 8

    • Subcomponent:

      Description

      SortedList as per TableView example

                                      SortedList<T> sortedList = new SortedList<>( unsortedList );
                                      table.setItems( sortedList);
                                      sortedList.comparatorProperty().bind( table.comparatorProperty() );

      With the table in an un-sorted state
      - clear selection and remove an item from the underlying unsortedList
      - click column to sort
                      - ascending OK
                      - descending OK
                      - unsorted FAILS with ArrayIndexOutOfBoundsException exception

      (Note - if the table was in a sorted state when the object is removed, it works OK)

      Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: 12
                      at javafx.collections.transformation.SortedList.doSortWithPermutationChange(SortedList.java:200)
                      at javafx.collections.transformation.SortedList.access$100(SortedList.java:54)
                      at javafx.collections.transformation.SortedList$1.invalidated(SortedList.java:130)
                      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
                      at javafx.beans.property.ObjectPropertyBase.access$000(ObjectPropertyBase.java:51)
                      at javafx.beans.property.ObjectPropertyBase$Listener.invalidated(ObjectPropertyBase.java:232)
                      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:339)
                      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
                      at javafx.beans.property.ReadOnlyObjectWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyObjectWrapper.java:176)
                      at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:142)
                      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
                      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:145)
                      at javafx.scene.control.TableView.setComparator(TableView.java:1074)
                      at javafx.scene.control.TableView.sort(TableView.java:1410)
                      at javafx.scene.control.TableView.doSort(TableView.java:1460)
                      at javafx.scene.control.TableView.access$100(TableView.java:354)
                      at javafx.scene.control.TableView$4.onChanged(TableView.java:532)
                      at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:315)
                      at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:72)
                      at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
                      at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
                      at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
                      at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
                      at javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:183)
                      at javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:171)
                      at com.sun.javafx.scene.control.skin.TableColumnHeader.sortColumn(TableColumnHeader.java:732)
                      at com.sun.javafx.scene.control.skin.TableColumnHeader.access$600(TableColumnHeader.java:70)
                      at com.sun.javafx.scene.control.skin.TableColumnHeader$7.handle(TableColumnHeader.java:244)
                      at com.sun.javafx.scene.control.skin.TableColumnHeader$7.handle(TableColumnHeader.java:232)
                      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
                      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
                      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
                      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
                      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
                      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
                      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
                      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
                      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
                      at javafx.event.Event.fireEvent(Event.java:204)
                      at javafx.scene.Scene$MouseHandler.process(Scene.java:3746)
                      at javafx.scene.Scene$MouseHandler.access$1800(Scene.java:3471)
                      at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1695)
                      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2486)
                      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:314)
                      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:243)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:345)
                      at com.sun.glass.ui.View.handleMouseEvent(View.java:526)
                      at com.sun.glass.ui.View.notifyMouse(View.java:898)
                      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
                      at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
                      at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
                      at java.lang.Thread.run(Thread.java:744)

        Attachments

          Activity

            People

            Assignee:
            msladecek Martin Sládeček
            Reporter:
            swpalmer Scott Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: