This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The view model is asked every time for children count and subsequently for children. This causes two times more communication than necessary, for most models.
Either the children can be cached between getChildrenCount() and getChildren() calls, or getChildren(Object node) method would have to be introduced.
Also the contract is not much clear. The number of children can change between getChildrenCount() and getChildren() calls. Therefore getChildren() must be robust enough to check for "from" and "to" parameters being out of bounds. Therefore one can also use getChildren(Object node, 0, Integer.MAX_VALUE), right?
The call getChildren(Object node, 0, Integer.MAX_VALUE) can cause problems in models, which count on values returned by getChildrenCount() without additional checks (static, or somehow synchronized models). A little less offensive would be to return Integer.MAX_VALUE from getChildrenCount() in specific models and adjust the "to" argument in getChildren(). - After issue #57573 is fixed, this should not impose any problems.
*** Issue 57410 has been marked as a duplicate of this issue. ***
We return Integer.MAX_VALUE in getChildrenCount() so that we do not have to compute the children twice: /cvs/debuggercore/src/org/netbeans/modules/debugger/ui/models/BreakpointsTreeModel.java,v <-- BreakpointsTreeModel.java new revision: 1.10; previous revision: 1.9 /cvs/debuggercore/src/org/netbeans/modules/debugger/ui/models/SessionsTreeModel.java,v <-- SessionsTreeModel.java new revision: 1.7; previous revision: 1.6 /cvs/debuggercore/src/org/netbeans/modules/debugger/ui/models/WatchesTreeModel.java,v <-- WatchesTreeModel.java new revision: 1.10; previous revision: 1.9 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/CallStackTreeModel.java,v <-- CallStackTreeModel.java new revision: 1.18; previous revision: 1.17 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/ClassesTreeModel.java,v <-- ClassesTreeModel.java new revision: 1.15; previous revision: 1.14 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/LocalsTreeModel.java,v <-- LocalsTreeModel.java new revision: 1.39; previous revision: 1.38 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/ThreadsTreeModel.java,v <-- ThreadsTreeModel.java new revision: 1.8; previous revision: 1.7 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/WatchesModel.java,v <-- WatchesModel.java new revision: 1.31; previous revision: 1.30 /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/FixedWatchesManager.java,v <-- FixedWatchesManager.java new revision: 1.17; previous revision: 1.16 /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/models/MonitorModel.java,v <-- MonitorModel.java new revision: 1.16; previous revision: 1.15 /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/models/SourcesModel.java,v <-- SourcesModel.java new revision: 1.18; previous revision: 1.17 /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/models/VariablesTreeModelFilterSI.java,v <-- VariablesTreeModelFilterSI.java new revision: 1.12; previous revision: 1.11
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.