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.
I am trying to fix bug 204645, but whenever I try to debug the problem, the debugger becomes stuck in evaluation of various variables and watches and becomes unusuable. The bug 204645 is about having 10000 files in a folder and trying to select them in a favorites tab. This causes deep recursion. I have modified DataNode.java method to stop when the recursion is at least 300 stack frames: public void beforeLookup(Class<?> clazz) { if (clazz.isAssignableFrom(FileObject.class)) { Exception e = new Exception(); final int len = e.getStackTrace().length; System.err.println("depth: " + len); if (len > 300) { System.err.println("too deep"); } updateFilesInCookieSet(obj.files()); } } } and I put breakpoint on the System.err line. When the debugger is stopped, I am trying to inspect individual occurences of ProxyLookup.R.computeResult. Soon, the debugger stops being responsive.
I've reproduced that. At first sight it looks to me like the loop that is causing stack overflow is somehow continuing during the evaluation...
Intersting. And yes, toString() might trigger it.
I do not think I can do something particular about it. The debugger simply needs to be customized so that it does not call any method that takes long time to execute (or does not finish at all). Many frames are in ProxyLookup$LazyCollection or ProxyLookup$LazyList. Since this implements List interface, debugger tries to show it's size. This triggers the loop, therefore you need to press "Open Formatters Options" button on the left side of the Variables window and uncheck "Default Collection Formatter". Since LazyCollection.toString() calls delegate(), which triggers the loop, you need to prevent from that and remove the toString() column as well as assure that the "$" button in unchecked.
Can you detect that an evalution (of certain type) takes too long and offer the user to disable it? That would be nice improvement, as otherwise it is hard for users to understand what is going on. Possibly you replace the "evaluating..." text in the variable field with something like "click to evalute..." for these slow types.