From 5bd7697d8f8a78f9369fe79386c36ed963144ea4 Mon Sep 17 00:00:00 2001 From: Denis Zhdanov Date: Mon, 18 May 2015 10:09:48 +0300 Subject: [PATCH] Trying to use LocalFileSystemImpl in upsource --- .../openapi/vfs/newvfs/RefreshSessionImpl.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java index e760233798d1..e2143dd43eea 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/RefreshSessionImpl.java @@ -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(); }