Trying to use LocalFileSystemImpl in upsource

This commit is contained in:
Denis Zhdanov
2015-05-18 10:09:48 +03:00
parent 869b5ff9de
commit 5bd7697d8f
@@ -110,9 +110,16 @@ public class RefreshSessionImpl extends RefreshSession {
boolean haveEventsToFire = myFinishRunnable != null || !myEvents.isEmpty();
if (!workQueue.isEmpty()) {
LocalFileSystemImpl fs = (LocalFileSystemImpl)LocalFileSystem.getInstance();
fs.markSuspiciousFilesDirty(workQueue);
FileWatcher watcher = fs.getFileWatcher();
final LocalFileSystem fileSystem = LocalFileSystem.getInstance();
final FileWatcher watcher;
if (fileSystem instanceof LocalFileSystemImpl) {
LocalFileSystemImpl fs = (LocalFileSystemImpl)fileSystem;
fs.markSuspiciousFilesDirty(workQueue);
watcher = fs.getFileWatcher();
}
else {
watcher = null;
}
long t = 0;
if (LOG.isDebugEnabled()) {
@@ -124,7 +131,7 @@ public class RefreshSessionImpl extends RefreshSession {
if (myCancelled) break;
NewVirtualFile nvf = (NewVirtualFile)file;
if (!myIsRecursive && (!myIsAsync || !watcher.isWatched(nvf))) {
if (!myIsRecursive && (!myIsAsync || (watcher != null && !watcher.isWatched(nvf)))) {
// we're unable to definitely refresh synchronously by means of file watcher.
nvf.markDirty();
}