Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4822

Possible StackOverflowError in TreeModel.getSelectionControl().isSelectAll()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.0.0
    • Fix Version/s: None
    • Component/s: Components

      Description

      Steps to Reproduce

      https://zkfiddle.org/sample/3iqfah1/1-ZK-4822

      • Click the button

      Current Result

      java.lang.StackOverflowError
      org.zkoss.zul.AbstractTreeModel.getChildCountOptimized(AbstractTreeModel.java:246)
      	at org.zkoss.zul.AbstractTreeModel.dfSearch(AbstractTreeModel.java:271)
      	at org.zkoss.zul.AbstractTreeModel.dfSearch(AbstractTreeModel.java:272)
      	at org.zkoss.zul.AbstractTreeModel.dfSearch(AbstractTreeModel.java:272)
      	at org.zkoss.zul.AbstractTreeModel.getPath(AbstractTreeModel.java:259)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodeCount(AbstractTreeModel.java:843)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:891)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      	at org.zkoss.zul.AbstractTreeModel.getChildNodes(AbstractTreeModel.java:895)
      

      Expected Result

      No error.

      Debug Information

      https://github.com/zkoss/zk/blob/v9.5.1/zul/src/org/zkoss/zul/AbstractTreeModel.java#L939
      model.getAllNodes() is eagerly to list all nodes, which is inefficient.

      Workaround


        Attachments

          Activity

            People

            Assignee:
            rudyhuang rudyhuang
            Reporter:
            rudyhuang rudyhuang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: