-
Bug
-
Resolution: Fixed
-
Normal
-
8.0.0
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.