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

NPE in ScrollPaneSkin.scrollBoundsIntoView

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Win10, ADOPTIUM JDK21

      A DESCRIPTION OF THE PROBLEM :
      Showing ScrollPane with right conditions causes NPE. Opening window causes focusCleanup() and calls focus traversal listener in the skin and method scrollBoundsIntoView() gets null Bounds as it is not yet ready?

      java.lang.NullPointerException: Cannot invoke "javafx.geometry.Bounds.getMaxX()" because "<parameter1>" is null
      at javafx.scene.control.skin.ScrollPaneSkin.scrollBoundsIntoView(ScrollPaneSkin.java:977)
      at javafx.scene.control.skin.ScrollPaneSkin.lambda$initialize$9(ScrollPaneSkin.java:637)
      at com.sun.javafx.scene.traversal.TraversalEngine.notifyTraversedTo(TraversalEngine.java:91)
      at com.sun.javafx.scene.traversal.TopMostTraversalEngine.notifyTreeTraversedTo(TopMostTraversalEngine.java:126)
      at com.sun.javafx.scene.traversal.TopMostTraversalEngine.focusAndNotify(TopMostTraversalEngine.java:118)
      at com.sun.javafx.scene.traversal.TopMostTraversalEngine.traverseToFirst(TopMostTraversalEngine.java:139)
      at javafx.scene.Scene.focusInitial(Scene.java:2171)
      at javafx.scene.Scene$ScenePulseListener.focusCleanup(Scene.java:2562)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2583)
      at com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:401)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
      at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:400)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:430)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:598)
      at com.sun.javafx.tk.quantum.PaintCollector.liveRepaintRenderJob(PaintCollector.java:327)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$ViewEventNotification.run(GlassViewEventHandler.java:902)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$ViewEventNotification.run(GlassViewEventHandler.java:862)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleViewEvent$15(GlassViewEventHandler.java:944)
      at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:430)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleViewEvent(GlassViewEventHandler.java:943)
      at com.sun.glass.ui.View.handleViewEvent(View.java:535)
      at com.sun.glass.ui.View.notifyResize(View.java:875)
      at com.sun.glass.ui.win.WinView.notifyResize(WinView.java:91)
      at com.sun.glass.ui.win.WinWindow._setBounds(Native Method)
      at com.sun.glass.ui.win.WinWindow.setBounds(WinWindow.java:143)
      at com.sun.javafx.tk.quantum.WindowStage.setBounds(WindowStage.java:320)
      at javafx.stage.Window$TKBoundsConfigurator.apply(Window.java:1572)
      at javafx.stage.Window.applyBounds(Window.java:1430)
      at javafx.stage.Window.adjustSize(Window.java:333)
      at javafx.stage.Window.sizeToScene(Window.java:299)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Opening Stage with ScrollPane. Unfortunately, I'm unable to provide reproducible example as this happens in a complex form in custom Stage window in complex application. The window showing code is something like this

      stage.show()
      scene.root = root
      stage.sizeToScene()
      stage.focus()

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No NPE

      ---------- BEGIN SOURCE ----------
      Sry, this time unable to provide so far. Would take hours.
      ---------- END SOURCE ----------

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: