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.
See the attached stack traces. I just put Thread.dumpStack into Children.Keys.applyKeys. Then I ran the IDE with setup as in issue #48630, expanded some project logical nodes to the file level, and began moving up and down. Stack traces are only from the period *after* I had expanded everything I was going to expand. So you can see that even for already-expanded node trees, Children.Keys.getArray is often calling addNotify. This must mean that the 'array' reference has been cleared. Which is not surprising, since it is a weak reference! Meaning it will be cleared constantly. Surely at least *currently expanded* children could hold their nodes strongly, or softly, or something.
Created attachment 17485 [details] Some stack traces
CCing Jarda as it is probably hi weak reference in case you are talking about org.openide.nodes.Children.array.
I think it is Reference Children.array I am referring to. It is always set to a WeakReference.
It is not true that the opened nodes are garbage collected. They are not. The problem is in the project nodes which are closed. If you go up and down through the explorer the SubnodesSearchInfo.canSearch() asks for all nodes of given node. (Notice that all the stack traces have the SSI in them) The PackageViewChildren are created and then obviously GCed because the node is collapsed. Wondering if this behavior of the SSI is realy necessary.
My suggestion is that LogicalView.RootNode lookup() should provide optimalized SearchInfo (see org.openidex.search API). Possibly always returning true.
My, you're right. The SubnodesSearchInfo is just ridiculous. I can't imagine any circumstance where you would want the default implementation of canSearch; it means a recursive traversal of all subnodes, doesn't it?? Or at least expanding down to folders, which is bad enough. I will try hardcoding canSearch to true and see if that helps things.
Thanks for the tip. Dramatically speeds up navigation. committed * Up-To-Date 1.14 java/project/src/org/netbeans/spi/java/project/support/ui/PackageRootNode.java committed * Up-To-Date 1.42 java/project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java committed * Up-To-Date 1.30 projects/projectui/src/org/netbeans/modules/project/ui/ProjectsRootNode.java
> The SubnodesSearchInfo is just ridiculous. Isn't the API bad then?
Fix of this issue significantly improves the problem described in issue 48630 which has been identified as beta 2 stopper. Thus marking this one as a candidate for merge to release40_beta2 branch.
Re. whether the SubnodesSearchInfo is a bad API - well its implementation is correct. It's just slow. I imagine there could be some circumstance where you had some node which sometimes could be searched and sometimes couldn't be searched. That just isn't the case for the projects use case; of course you can search the project, there is no reason to do any further checks. I suppose you could disable Find in case the project was empty, or something like this, but that is just being pedantic; it provides no real value to the user, it just makes the IDE slower. Will try to merge to the beta2 branch.
Merged to release40_beta2: Checking in java/project/src/org/netbeans/spi/java/project/support/ui/PackageRootNode.java; /cvs/java/project/src/org/netbeans/spi/java/project/support/ui/PackageRootNode.java,v <-- PackageRootNode.java new revision: 1.12.4.1; previous revision: 1.12 done Checking in java/project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java; /cvs/java/project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java,v <-- PackageViewChildren.java new revision: 1.39.4.1; previous revision: 1.39 done Checking in projects/projectui/src/org/netbeans/modules/project/ui/ProjectsRootNode.java; /cvs/projects/projectui/src/org/netbeans/modules/project/ui/ProjectsRootNode.java,v <-- ProjectsRootNode.java new revision: 1.29.4.1; previous revision: 1.29 done
Verified.