add ProjectFileIndex.getInstance(Project) to simplify clients
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 17 Nov 2016 14:25:48 +0000 (17:25 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 17 Nov 2016 14:26:12 +0000 (17:26 +0300)
platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java

index 369866a3fa57c43a64ca4e076aca125a8d42e9fb..0ffe24353db675c10b95e363fa4cadb0a9f39a88 100644 (file)
@@ -34,11 +34,19 @@ public interface ProjectFileIndex extends FileIndex {
   class SERVICE {
     private SERVICE() { }
 
+    /**
+     * @deprecated use {@link ProjectFileIndex#getInstance(Project)} instead
+     */
     public static ProjectFileIndex getInstance(Project project) {
-      return ServiceManager.getService(project, ProjectFileIndex.class);
+      return ProjectFileIndex.getInstance(project);
     }
   }
 
+  @NotNull
+  static ProjectFileIndex getInstance(@NotNull Project project) {
+    return ServiceManager.getService(project, ProjectFileIndex.class);
+  }
+
   /**
    * Returns module to which content the specified file belongs or null if the file does not belong to content of any module.
    */