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 - addRecursiveListener call may take some time - make it interruptible
Summary: addRecursiveListener call may take some time - make it interruptible
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: Other Linux
: P1 normal (vote)
Assignee: Jaroslav Tulach
Depends on:
Reported: 2010-02-10 00:55 UTC by Jaroslav Tulach
Modified: 2010-03-18 10:08 UTC (History)
2 users (show)

See Also:
Exception Reporter:

FileUtil.addRecursiveListener(..., Callable<Boolean>) (10.70 KB, patch)
2010-03-10 00:51 UTC, Jaroslav Tulach
Details | Diff
Test for the new behavior (5.05 KB, text/x-java)
2010-03-10 02:40 UTC, Jaroslav Tulach

Note You need to log in before you can comment on or make changes to this bug.
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