From 2b1fc51f8946262c871a72a7b61b0626c2a8b45a Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Mon, 11 Dec 2023 17:32:20 +0100 Subject: [PATCH] [KLIB Resolver] Deprecate UnresolvedLibrary.substitutePath() This method in unused in Kotlin compiler and IDEA plugin. --- .../org/jetbrains/kotlin/library/UnresolvedLibrary.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt b/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt index 9917fefd105..76afe9f937a 100644 --- a/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt +++ b/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt @@ -11,13 +11,21 @@ fun UnresolvedLibrary(path: String, libraryVersion: String?, lenient: Boolean): sealed class UnresolvedLibrary { abstract val path: String abstract val libraryVersion: String? + + @Deprecated(DEPRECATED_SUBSTITUTE_PATH, level = DeprecationLevel.ERROR) abstract fun substitutePath(newPath: String): UnresolvedLibrary + + companion object { + const val DEPRECATED_SUBSTITUTE_PATH = + "UnresolvedLibrary.substitutePath() is deprecated and is going to be removed in one of the future Kotlin releases" + } } data class RequiredUnresolvedLibrary( override val path: String, override val libraryVersion: String? ) : UnresolvedLibrary() { + @Deprecated(DEPRECATED_SUBSTITUTE_PATH, ReplaceWith("copy(path = newPath)"), level = DeprecationLevel.ERROR) override fun substitutePath(newPath: String): RequiredUnresolvedLibrary { return copy(path = newPath) } @@ -27,6 +35,7 @@ data class LenientUnresolvedLibrary( override val path: String, override val libraryVersion: String? ) : UnresolvedLibrary() { + @Deprecated(DEPRECATED_SUBSTITUTE_PATH, ReplaceWith("copy(path = newPath)"), level = DeprecationLevel.ERROR) override fun substitutePath(newPath: String): LenientUnresolvedLibrary { return copy(path = newPath) }