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

ToolBarSkin: NPE in select()

XMLWordPrintable

    • master

        To reproduce, run the attached code (tried on macOS 15.5 M1) and manually resize the window to make it narrower than the toolbar button. An NPE gets thrown, though the app seems to continue working:

        Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.Parent.getParent()" because "item" is null
        at javafx.controls/javafx.scene.control.skin.ToolBarSkin$1.select(ToolBarSkin.java:195)
        at javafx.graphics/com.sun.javafx.scene.traversal.TraversalEngine.select(TraversalEngine.java:104)
        at javafx.graphics/com.sun.javafx.scene.traversal.TopMostTraversalEngine.trav(TopMostTraversalEngine.java:79)
        at javafx.graphics/javafx.scene.Scene.traverse(Scene.java:2220)
        at javafx.graphics/javafx.scene.Scene.focusIneligible(Scene.java:2239)
        at javafx.graphics/javafx.scene.Scene$ScenePulseListener.focusCleanup(Scene.java:2641)
        at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2656)
        at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:380)
        at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:401)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:592)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:572)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:565)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$6(QuantumToolkit.java:346)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)


        The bug surfaced when I was trying to reproduce JDK-8364049.

              angorya Andy Goryachev
              angorya Andy Goryachev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: