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

[ComboBox] index out of bounds exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • fx2.1
    • fx2.1
    • javafx
    • 2.1.0b13

    Description

      public class Issue1 extends Application {

          public static void main(String[] args) {
              launch(args);
          }
          final ComboBox testedComboBox = new ComboBox();

          @Override
          public void start(Stage stage) throws Exception {
              Pane pane = new Pane();
              pane.setPrefHeight(200);
              pane.setPrefWidth(200);

              pane.getChildren().add(testedComboBox);

              VBox vb = new VBox();

              ToggleButton toggleButton = new ToggleButton();
              
              toggleButton.selectedProperty().bindBidirectional(testedComboBox.editableProperty());

              vb.getChildren().addAll(pane, toggleButton);
              Scene scene = new Scene(vb, 400, 400);
              stage.setScene(scene);
              stage.show();
          }
      }

      Run Attached code, click toggle button to change to editable state. type "a" to textField of comboBox. Press enter. Catch exception:

      java.lang.ArrayIndexOutOfBoundsException: -1
      at java.util.ArrayList.elementData(ArrayList.java:371)
      at java.util.ArrayList.get(ArrayList.java:384)
      at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:208)
      at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin$2.changed(ComboBoxListViewSkin.java:88)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:367)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)
      at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:123)
      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:130)
      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:163)
      at javafx.scene.control.ComboBoxBase.setValue(ComboBoxBase.java:89)
      at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin$4.handle(ComboBoxListViewSkin.java:179)
      at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin$4.handle(ComboBoxListViewSkin.java:173)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
      at javafx.event.Event.fireEvent(Event.java:171)
      at javafx.scene.Scene$KeyHandler.process(Scene.java:3150)
      at javafx.scene.Scene$KeyHandler.access$1800(Scene.java:3080)
      at javafx.scene.Scene.impl_processKeyEvent(Scene.java:1500)
      at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:1931)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:114)
      at com.sun.glass.ui.View.handleKeyEvent(View.java:481)
      at com.sun.glass.ui.View.notifyKey(View.java:898)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
      at java.lang.Thread.run(Thread.java:722)


      actual for b13 and not actual for b12.

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: