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.

Bug 180523

Summary: addRecursiveListener call may take some time - make it interruptible
Product: platform Reporter: Jaroslav Tulach <jtulach>
Component: FilesystemsAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED FIXED    
Severity: normal CC: apireviews, jglick
Priority: P1 Keywords: API_REVIEW_FAST
Version: 6.x   
Hardware: Other   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: FileUtil.addRecursiveListener(..., Callable<Boolean>)
Test for the new behavior

Description Jaroslav Tulach 2010-02-10 00:55:26 UTC
On large trees of directories the call to FileObject.addRecursiveListener can be quite expensive. See bug 178999 for an example. Although the problem can be workarounded by rescheduling to the call to addRL to some background thread, it may need nicer API. One option is

public boolean addRecusiveListener(FCL, Callable<Boolean> callback);

which will allow the client to provide a callback and return false from it, to immediately stop further execution, effectively removing the listener.
Comment 1 Jaroslav Tulach 2010-03-10 00:51:17 UTC
Created attachment 94953 [details]
FileUtil.addRecursiveListener(..., Callable<Boolean>)
Comment 2 Jaroslav Tulach 2010-03-10 02:40:26 UTC
Created attachment 94959 [details]
Test for the new behavior
Comment 3 Jaroslav Tulach 2010-03-17 17:22:46 UTC
Let's integrate tomorrow.
Comment 4 Jesse Glick 2010-03-17 17:42:59 UTC
[JG01] Do not copy every detail of Javadoc; we cannot maintain duplicated specs. Refer to the simple overload for details, and only document the stop param.
Comment 5 Jaroslav Tulach 2010-03-18 10:08:56 UTC
core-main#f2104e0cf596