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

infinite loop in VirtualFlow # addTrailingCells

    XMLWordPrintable

Details

    Description

      I've got OutOfMemory Ex. I've done some search and debug, and have found that

      VirtualFlow has infinite loop in this code:
         while (offset < viewportLength) {
                  if (index >= getCellCount()) {
                      if (offset < viewportLength) filledWithNonEmpty = false;
                      if (! fillEmptyCells) return filledWithNonEmpty; // fillEmptyCells == true
                  }
                  IndexedCell cell = getAvailableCell(index);
                  setCellIndex(cell, index);
                  resizeCellSize(cell); // resize happens after config!
                  cells.addLast(cell);

                  // Position the cell and update the max pref
                  positionCell(cell, offset);
                  maxPrefBreadth = Math.max(maxPrefBreadth, getCellBreadth(cell));

                  offset += getCellLength(cell); // this code always return 0 because Bounds == {all 0}
                  cell.setVisible(true);
                  ++index;
           }


      getCellLength(cell) always 0 than offset olways 0;


      JavaFX Application Thread@237, prio=5, in group 'main', status: 'RUNNING'
      at com.sun.javafx.scene.control.skin.VirtualFlow.addTrailingCells(VirtualFlow.java:1109)
      at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1007)
      at com.sun.javafx.scene.control.skin.VirtualFlow.setCellCount(VirtualFlow.java:206)
      at com.sun.javafx.scene.control.skin.TreeViewSkin.updateItemCount(TreeViewSkin.java:225)
      at com.sun.javafx.scene.control.skin.TreeViewSkin.handleControlPropertyChanged(TreeViewSkin.java:135)
      at com.sun.javafx.scene.control.skin.SkinBase$3.changed(SkinBase.java:282)
      at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:107)
      at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:196)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)
      at javafx.beans.property.IntegerPropertyBase.fireValueChangedEvent(IntegerPropertyBase.java:123)
      at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:130)
      at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:163)
      at javafx.scene.control.TreeView.setTreeItemCount(TreeView.java:515)
      at javafx.scene.control.TreeView.updateTreeItemCount(TreeView.java:876)
      at javafx.scene.control.TreeView.updateRootExpanded(TreeView.java:928)
      at javafx.scene.control.TreeView.access$400(TreeView.java:118)
      at javafx.scene.control.TreeView$2.invalidated(TreeView.java:358)
      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:129)
      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:163)
      at javafx.scene.control.TreeView.setRoot(TreeView.java:378)

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            adyominjfx Andrey Dyomin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: