From 07e2ace95cd472954de4282b09769c057ab5dc12 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Fri, 10 Feb 2017 00:02:00 +0300 Subject: [PATCH] deprecate getAdditionalProjectLibrarySourceRoots; rename newFixedLibrary to newImmutableLibrary (IDEA-CR-17846) --- .../com/intellij/openapi/roots/impl/DirectoryIndexTest.java | 2 +- .../openapi/roots/AdditionalLibraryRootsProvider.java | 5 ++++- .../src/com/intellij/openapi/roots/SyntheticLibrary.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java b/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java index 090106340027..625be9434700 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java +++ b/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java @@ -160,7 +160,7 @@ public class DirectoryIndexTest extends IdeaTestCase { @Override public Collection getAdditionalProjectLibraries(@NotNull Project project) { return myProject == project ? Collections.singletonList( - SyntheticLibrary.newFixedLibrary(null, Collections.singletonList(myLibAdditionalSrcDir)) + SyntheticLibrary.newImmutableLibrary(null, Collections.singletonList(myLibAdditionalSrcDir)) ) : Collections.emptyList(); } }, getTestRootDisposable()); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/AdditionalLibraryRootsProvider.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/AdditionalLibraryRootsProvider.java index 4dec10b79fd5..98da9d370816 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/AdditionalLibraryRootsProvider.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/AdditionalLibraryRootsProvider.java @@ -53,9 +53,12 @@ public abstract class AdditionalLibraryRootsProvider { if (roots.isEmpty()) { return Collections.emptyList(); } - return Collections.singletonList(SyntheticLibrary.newFixedLibrary(null, roots)); + return Collections.singletonList(SyntheticLibrary.newImmutableLibrary(null, roots)); } + /** + * @deprecated use {@link #getAdditionalProjectLibraries(Project)} instead + */ @SuppressWarnings("DeprecatedIsStillUsed") @NotNull public Collection getAdditionalProjectLibrarySourceRoots(@NotNull Project project) { diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/SyntheticLibrary.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/SyntheticLibrary.java index 43b8f98ae190..2d2605452478 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/SyntheticLibrary.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/SyntheticLibrary.java @@ -53,7 +53,7 @@ public abstract class SyntheticLibrary { public abstract Collection getSourceRoots(); @NotNull - public static SyntheticLibrary newFixedLibrary(@Nullable String name, @NotNull Collection sourceRoots) { + public static SyntheticLibrary newImmutableLibrary(@Nullable String name, @NotNull Collection sourceRoots) { return new SyntheticLibrary() { @Nullable @Override