The collecting of files and status update is performed in the BLD200301080100
authormentlicher@netbeans.org
Tue, 07 Jan 2003 15:48:39 +0000
changeset 2979ea055c3c6a57
parent 2978 f8ec44ce39ba
child 2980 1f3a75b751bc
The collecting of files and status update is performed in the
StatusChangeRequestProcessor to prevent from deadlocks.
This is a fix of issue #29814.
vcscore/src/org/netbeans/modules/vcscore/VcsVersioningSystem.java
     1.1 --- a/vcscore/src/org/netbeans/modules/vcscore/VcsVersioningSystem.java	Tue Jan 07 10:42:37 2003 +0000
     1.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/VcsVersioningSystem.java	Tue Jan 07 15:48:39 2003 +0000
     1.3 @@ -381,7 +381,7 @@
     1.4          fireVcsFileStatusChanged(new VcsFileStatusEvent(this, s));
     1.5      }
     1.6  
     1.7 -    public void vcsStatusChanged (String name) {
     1.8 +    private void vcsStatusChanged (String name) {
     1.9          FileObject fo = findExistingResource(name);
    1.10          if (fo == null) return;
    1.11          fireVcsFileStatusChanged (new VcsFileStatusEvent(this, Collections.singleton(fo)));
    1.12 @@ -392,23 +392,27 @@
    1.13       * The filesystem has to decide wheater it affects him (only in case when
    1.14       * there's not the 1-to-1 relationship between cache and fs.
    1.15       */
    1.16 -    public void statusChanged(CacheHandlerEvent event) {
    1.17 -        String root = fileSystem.getRootDirectory().getAbsolutePath();
    1.18 -        String absPath = event.getCacheFile().getAbsolutePath();
    1.19 +    public void statusChanged(final CacheHandlerEvent event) {
    1.20 +        final String root = fileSystem.getRootDirectory().getAbsolutePath();
    1.21 +        final String absPath = event.getCacheFile().getAbsolutePath();
    1.22          if (absPath.startsWith(root)) { // it belongs to this FS -> do something
    1.23              //D.deb("-------- it is in this filesystem");
    1.24 -            String path;
    1.25 -            if (root.length() == absPath.length()) {
    1.26 -                path = "";
    1.27 -            } else {
    1.28 -                path = absPath.substring(root.length() + 1, absPath.length());
    1.29 -            }
    1.30 -            path = path.replace(java.io.File.separatorChar, '/');
    1.31 -            if (event.getCacheFile() instanceof org.netbeans.modules.vcscore.cache.CacheDir) {
    1.32 -                vcsStatusChanged(path, event.isRecursive());
    1.33 -            } else {
    1.34 -                vcsStatusChanged(path);
    1.35 -            }
    1.36 +            VcsFileSystem.getStatusChangeRequestProcessor().post(new Runnable() {
    1.37 +                public void run() {
    1.38 +                    String path;
    1.39 +                    if (root.length() == absPath.length()) {
    1.40 +                        path = "";
    1.41 +                    } else {
    1.42 +                        path = absPath.substring(root.length() + 1, absPath.length());
    1.43 +                    }
    1.44 +                    path = path.replace(java.io.File.separatorChar, '/');
    1.45 +                    if (event.getCacheFile() instanceof org.netbeans.modules.vcscore.cache.CacheDir) {
    1.46 +                        vcsStatusChanged(path, event.isRecursive());
    1.47 +                    } else {
    1.48 +                        vcsStatusChanged(path);
    1.49 +                    }
    1.50 +                }
    1.51 +            });
    1.52          }
    1.53      }
    1.54