Details
Description
This bug was found by adding a MenuBar to a Toolbar and reducing the width of the stage so that the toolbar puts the menu bar in "side dropdown menu". When the MenuItem was clicked, this results in IndexOutOfBoundsException.
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(ObservableListWrapper.java:208)
at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.computePrefHeight(ContextMenuContent.java:
1273)
at javafx.scene.Parent.prefHeight(Parent.java:879)
at javafx.scene.layout.Region.prefHeight(Region.java:1384)
at com.sun.javafx.scene.control.skin.ContextMenuContent.getContentHeight(ContextMenuContent.java:319)
at com.sun.javafx.scene.control.skin.ContextMenuContent.computePrefHeight(ContextMenuContent.java:289)
at javafx.scene.Parent.prefHeight(Parent.java:879)
at javafx.scene.layout.Region.prefHeight(Region.java:1384)
at javafx.scene.Node.autosize(Node.java:2611)
at javafx.scene.Parent.layoutChildren(Parent.java:1048)
at javafx.scene.Group.layoutChildren(Group.java:160)
at javafx.scene.Parent.layout(Parent.java:1018)
at javafx.scene.Parent.layout(Parent.java:1028)
at javafx.scene.Scene.layoutDirtyRoots(Scene.java:513)
at javafx.scene.Scene.doLayoutPass(Scene.java:484)
at javafx.scene.Scene.access$3900(Scene.java:169)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2199)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:329)
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$3$1.run(WinApplication.java:73)
at java.lang.Thread.run(Unknown Source)
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(ObservableListWrapper.java:208)
at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.computePrefHeight(ContextMenuContent.java:
1273)
at javafx.scene.Parent.prefHeight(Parent.java:879)
at javafx.scene.layout.Region.prefHeight(Region.java:1384)
at com.sun.javafx.scene.control.skin.ContextMenuContent.getContentHeight(ContextMenuContent.java:319)
at com.sun.javafx.scene.control.skin.ContextMenuContent.computePrefHeight(ContextMenuContent.java:289)
at javafx.scene.Parent.prefHeight(Parent.java:879)
at javafx.scene.layout.Region.prefHeight(Region.java:1384)
at javafx.scene.Node.autosize(Node.java:2611)
at javafx.scene.Parent.layoutChildren(Parent.java:1048)
at javafx.scene.Group.layoutChildren(Group.java:160)
at javafx.scene.Parent.layout(Parent.java:1018)
at javafx.scene.Parent.layout(Parent.java:1028)
at javafx.scene.Scene.layoutDirtyRoots(Scene.java:513)
at javafx.scene.Scene.doLayoutPass(Scene.java:484)
at javafx.scene.Scene.access$3900(Scene.java:169)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2199)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:329)
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$3$1.run(WinApplication.java:73)
at java.lang.Thread.run(Unknown Source)