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

NPE in TreeCellSkin when TreeCell disclosureNode is set to null

    XMLWordPrintable

    Details

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

      jdk-8-ea-bin-b76-windows-i586-07_feb_2013

      Description

      In a private mail conversation with Jonathan Giles we discovered the following problem:

      TreeCells are created by a custom TreeViewSkin. These TreeCells however donot get a disclosureNode set, so it remains null. When the default TreeCellSkin is used, this results in a NPE in computePrefWidth:

      java.lang.NullPointerException
      at com.sun.javafx.scene.control.skin.TreeCellSkin.computePrefWidth(TreeCellSkin.java:272)
      at javafx.scene.control.Control.computePrefWidth(Control.java:509)
      at javafx.scene.Parent.prefWidth(Parent.java:863)
      at javafx.scene.layout.Region.prefWidth(Region.java:1153)
      at javafx.scene.control.SkinBase.computePrefWidth(SkinBase.java:251)
      at javafx.scene.control.Control.computePrefWidth(Control.java:509)
      at javafx.scene.Parent.prefWidth(Parent.java:863)
      at javafx.scene.layout.Region.prefWidth(Region.java:1153)
      at javafx.scene.control.SkinBase.computeMinWidth(SkinBase.java:193)
      at javafx.scene.control.Control.computeMinWidth(Control.java:442)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1337)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1325)
      at javafx.scene.layout.BorderPane.computeMinWidth(BorderPane.java:385)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1337)
      at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:1525)
      at javafx.scene.layout.Region.computeMaxMinAreaWidth(Region.java:1438)
      at javafx.scene.layout.StackPane.computeMinWidth(StackPane.java:258)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1337)
      at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:1525)
      at javafx.scene.layout.Region.computeMaxMinAreaWidth(Region.java:1438)
      at javafx.scene.layout.StackPane.computeMinWidth(StackPane.java:258)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildPrefAreaHeight(Region.java:1387)
      at javafx.scene.layout.GridPane.computeRowMetrics(GridPane.java:1222)
      at javafx.scene.layout.GridPane.computeGridMetrics(GridPane.java:1120)
      at javafx.scene.layout.GridPane.computeMinWidth(GridPane.java:989)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildPrefAreaHeight(Region.java:1387)
      at javafx.scene.layout.GridPane.computeRowMetrics(GridPane.java:1222)
      at javafx.scene.layout.GridPane.computeGridMetrics(GridPane.java:1120)
      at javafx.scene.layout.GridPane.computeMinWidth(GridPane.java:989)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1337)
      at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:1525)
      at javafx.scene.layout.Region.computeMaxMinAreaWidth(Region.java:1438)
      at javafx.scene.layout.StackPane.computeMinWidth(StackPane.java:258)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1337)
      at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:1525)
      at javafx.scene.layout.Region.computeMaxMinAreaWidth(Region.java:1438)
      at javafx.scene.layout.StackPane.computeMinWidth(StackPane.java:258)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1337)
      at javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1325)
      at javafx.scene.layout.BorderPane.computeMinWidth(BorderPane.java:385)
      at javafx.scene.Parent.minWidth(Parent.java:887)
      at javafx.scene.layout.Region.minWidth(Region.java:1117)
      at javafx.scene.layout.Region.layoutInArea(Region.java:1801)
      at javafx.scene.layout.Region.layoutInArea(Region.java:1767)
      at javafx.scene.layout.Region.layoutInArea(Region.java:1708)
      at javafx.scene.layout.StackPane.layoutChildren(StackPane.java:337)
      at javafx.scene.Parent.layout(Parent.java:1014)
      at javafx.scene.Scene.layoutDirtyRoots(Scene.java:537)
      at javafx.scene.Scene.doLayoutPass(Scene.java:508)
      at javafx.scene.Scene.access$4000(Scene.java:179)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2193)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:347)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:524)
      at com.sun.javafx.tk.quantum.QuantumToolkit$12.run(QuantumToolkit.java:377)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(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$3$1.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:722)

        Attachments

          Activity

            People

            Assignee:
            jgiles Jonathan Giles
            Reporter:
            jhendrikx John Hendrikx
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved:
              Imported: