Please use the Apache issue tracking system for new NetBeans 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 QA Contact: issues <>
Priority: P1 CC: apireviews, jglick
Version: 6.xKeywords: API_REVIEW_FAST
Target Milestone: 6.x   
Hardware: Other   
OS: Linux   
Issue Type: ENHANCEMENT Exception Report:
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
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo