From 45fd0cbaca2d3233209d8ca6f5d7879454d6042a Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 11 Sep 2019 07:13:11 +0200 Subject: [PATCH] do not use getComponentInstancesOfType() in PlatformVirtualFileManager because it slow-down start-up and leads to loading of unrelated classes (because PlatformVirtualFileManager is a preloaded service) Warn was released as 2019.2, so, any plugin that not yet migrated to a correct API, must be also migrated. GitOrigin-RevId: 5b3bfb9d4622dae848becea5e3a85cfe7392779f --- .../vfs/PlatformVirtualFileManager.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/PlatformVirtualFileManager.java b/platform/platform-impl/src/com/intellij/openapi/vfs/PlatformVirtualFileManager.java index 5acf100d317e..1b9896f2a40b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/PlatformVirtualFileManager.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/PlatformVirtualFileManager.java @@ -1,9 +1,7 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vfs; -import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.impl.ComponentManagerImpl; import com.intellij.openapi.vfs.impl.VirtualFileManagerImpl; import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.RefreshQueue; @@ -13,31 +11,16 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collections; -import java.util.List; public final class PlatformVirtualFileManager extends VirtualFileManagerImpl { @NotNull private final ManagingFS myManagingFS; public PlatformVirtualFileManager() { - super(getVirtualFileSystems()); + super(Collections.emptyList()); myManagingFS = ManagingFS.getInstance(); } - @NotNull - private static List getVirtualFileSystems() { - Application app = ApplicationManager.getApplication(); - @SuppressWarnings("deprecation") - List result = app instanceof ComponentManagerImpl - ? app.getComponentInstancesOfType(VirtualFileSystem.class, true) - : Collections.emptyList(); - if (!result.isEmpty()) { - LOG.warn("Do not register file system as application component, instead, register as extension, for example:\n" + - "\n\n" + result); - } - return result; - } - @Override protected long doRefresh(boolean asynchronous, @Nullable Runnable postAction) { if (!asynchronous) {