From 839b903dbb8a5b56081ec261553ee759b0dc7db6 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 4 Jun 2018 12:41:07 +0200 Subject: [PATCH] create VfsData manually, no need for app component --- .../src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java | 4 ---- .../openapi/vfs/newvfs/persistent/PersistentFSImpl.java | 5 +++-- platform/platform-resources/src/componentSets/Platform.xml | 3 --- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java index 9eb216fb2152..97cc7726bef5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsData.java @@ -101,10 +101,6 @@ public class VfsData { }); } - public static VfsData getInstance() { - return ApplicationManager.getApplication().getComponent(VfsData.class); - } - private void killInvalidatedFiles() { synchronized (myDeadMarker) { if (!myDyingIds.isEmpty()) { diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java index f9be4dcb77ab..be7de6237ef8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java @@ -68,6 +68,7 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone private final AtomicBoolean myShutDown = new AtomicBoolean(false); private final AtomicInteger myStructureModificationCount = new AtomicInteger(); private final BulkFileListener myPublisher; + private final VfsData myVfsData = new VfsData(); public PersistentFSImpl(@NotNull MessageBus bus) { ShutDownTracker.getInstance().registerShutdownTask(this::performShutdown); @@ -994,7 +995,7 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone int rootId = FSRecords.findRootRecord(rootUrl); - VfsData.Segment segment = VfsData.getInstance().getSegment(rootId, true); + VfsData.Segment segment = myVfsData.getSegment(rootId, true); VfsData.DirectoryData directoryData = new VfsData.DirectoryData(); VirtualFileSystemEntry newRoot = new FsRoot(rootId, segment, directoryData, fs, rootName, StringUtil.trimTrailing(rootPath, '/')); @@ -1062,7 +1063,7 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone @Override public NewVirtualFile findFileByIdIfCached(final int id) { - return VfsData.getInstance().hasLoadedFile(id) ? findFileById(id) : null; + return myVfsData.hasLoadedFile(id) ? findFileById(id) : null; } @Override diff --git a/platform/platform-resources/src/componentSets/Platform.xml b/platform/platform-resources/src/componentSets/Platform.xml index 12d26ca12993..b9eda48226bd 100644 --- a/platform/platform-resources/src/componentSets/Platform.xml +++ b/platform/platform-resources/src/componentSets/Platform.xml @@ -24,9 +24,6 @@ com.intellij.openapi.vfs.newvfs.ManagingFS com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl - - com.intellij.openapi.vfs.newvfs.impl.VfsData - com.intellij.openapi.vfs.LocalFileSystem