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

[ChoiceBox] ChoiceBox with no choices causes IndexOutOfBounds exception if clicked on.

    Details

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

      Windows 7 64-bit
      java version "1.8.0-ea"
      Java(TM) SE Runtime Environment (build 1.8.0-ea-b120)
      Java HotSpot(TM) 64-Bit Server VM (build 25.0-b62, mixed mode)

      Description

      I have a ChoiceBox where the choices are computed. In some cases this may result in no choices ever being set on it. Clicking the control in this state causes the following:

      Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
              at java.util.ArrayList.rangeCheck(Unknown Source)
              at java.util.ArrayList.get(Unknown Source)
              at com.sun.javafx.collections.ObservableListWrapper.get(Unknown Source)
              at com.sun.javafx.scene.control.skin.ChoiceBoxSkin.handleControlPropertyChanged(Unknown Source)
              at com.sun.javafx.scene.control.skin.BehaviorSkinBase$2.call(Unknown Source)
              at com.sun.javafx.scene.control.skin.BehaviorSkinBase$2.call(Unknown Source)
              at com.sun.javafx.scene.control.MultiplePropertyChangeListenerHandler$1.changed(Unknown Source)
              at javafx.beans.value.WeakChangeListener.changed(Unknown Source)
              at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
              at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
              at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(Unknown Source)
              at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.access$100(Unknown Source)
              at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(Unknown Source)
              at javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
              at javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
              at javafx.scene.control.ChoiceBox.show(Unknown Source)
              at com.sun.javafx.scene.control.behavior.ChoiceBoxBehavior.mouseReleased(Unknown Source)
              at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
              at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
              at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
              at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
              at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
              at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
              at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
              at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
              at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
              at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
              at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
              at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
              at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
              at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
              at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
              at javafx.event.Event.fireEvent(Unknown Source)
              at javafx.scene.Scene$MouseHandler.process(Unknown Source)
              at javafx.scene.Scene$MouseHandler.access$1800(Unknown Source)
              at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
              at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
              at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
              at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
              at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
              at com.sun.glass.ui.View.notifyMouse(Unknown Source)
              at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
              at com.sun.glass.ui.win.WinApplication.access$300(Unknown Source)
              at com.sun.glass.ui.win.WinApplication$4$1.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)

        Attachments

          Activity

            People

            • Assignee:
              jgiles Jonathan Giles
              Reporter:
              swpalmer Scott Palmer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: