diff --git a/libraries/stdlib/src/kotlin/collections/JUtil.kt b/libraries/stdlib/src/kotlin/collections/JUtil.kt index 6e486e64257..4577b4ee004 100644 --- a/libraries/stdlib/src/kotlin/collections/JUtil.kt +++ b/libraries/stdlib/src/kotlin/collections/JUtil.kt @@ -94,7 +94,7 @@ public val Collection<*>.indices: IntRange /** * Returns an [IntRange] that starts with zero and ends at the value of this number but does not include it. */ -deprecated("Use 0..n-1 range instead.") +deprecated("Use 0..n-1 range instead.", ReplaceWith("0..this - 1")) public val Int.indices: IntRange get() = 0..this - 1 diff --git a/libraries/stdlib/src/kotlin/collections/Sequence.kt b/libraries/stdlib/src/kotlin/collections/Sequence.kt index 97a04d45ce1..51a651e2e5b 100644 --- a/libraries/stdlib/src/kotlin/collections/Sequence.kt +++ b/libraries/stdlib/src/kotlin/collections/Sequence.kt @@ -41,7 +41,7 @@ public fun Iterator.asSequence(): Sequence { return iteratorSequence.constrainOnce() } -deprecated("Use asSequence() instead.") +deprecated("Use asSequence() instead.", ReplaceWith("asSequence()")) public fun Iterator.sequence(): Sequence = asSequence() @@ -596,7 +596,7 @@ public fun sequence(nextFunction: () -> T?): Sequence { return GeneratorSequence(nextFunction, { nextFunction() }).constrainOnce() } -deprecated("Use sequence() instead") +deprecated("Use sequence() instead", ReplaceWith("sequence(nextFunction)")) public fun stream(nextFunction: () -> T?): Sequence = sequence(nextFunction) /** @@ -616,5 +616,5 @@ public /*inline*/ fun sequence(initialValue: T, nextFunction: (T) -> T public fun sequence(initialValueFunction: () -> T?, nextFunction: (T) -> T?): Sequence = GeneratorSequence(initialValueFunction, nextFunction) -deprecated("Use sequence() instead") +deprecated("Use sequence() instead", ReplaceWith("sequence(initialValue, nextFunction)")) public /*inline*/ fun stream(initialValue: T, nextFunction: (T) -> T?): Sequence = sequence(initialValue, nextFunction) diff --git a/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt b/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt index e51132c6459..4b048dcb5a4 100644 --- a/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt +++ b/libraries/stdlib/src/kotlin/deprecated/Deprecated.kt @@ -2,10 +2,10 @@ package kotlin import java.util.* -deprecated("Use firstOrNull function instead.") +deprecated("Use firstOrNull function instead.", ReplaceWith("firstOrNull(predicate)")) public inline fun Array.find(predicate: (T) -> Boolean): T? = firstOrNull(predicate) -deprecated("Use firstOrNull function instead.") +deprecated("Use firstOrNull function instead.", ReplaceWith("firstOrNull(predicate)")) public inline fun Iterable.find(predicate: (T) -> Boolean): T? = firstOrNull(predicate) deprecated("Use listOf(...) or arrayListOf(...) instead") @@ -20,7 +20,7 @@ public fun hashMap(vararg values: Pair): HashMap = hashMapOf( deprecated("Use listOf(...) or linkedListOf(...) instead") public fun linkedList(vararg values: T): LinkedList = linkedListOf(*values) -deprecated("Use linkedMapOf(...) instead") +deprecated("Use linkedMapOf(...) instead", ReplaceWith("linkedMapOf(*values)")) public fun linkedMap(vararg values: Pair): LinkedHashMap = linkedMapOf(*values) /** Copies all characters into a [[Collection] */ @@ -61,7 +61,7 @@ public /*inline*/ fun runnable(action: () -> Unit): Runnable { } } -deprecated("Use forEachIndexed instead.") +deprecated("Use forEachIndexed instead.", ReplaceWith("forEachIndexed(operation)")) public inline fun List.forEachWithIndex(operation: (Int, T) -> Unit): Unit = forEachIndexed(operation) deprecated("Function with undefined semantic") @@ -70,40 +70,40 @@ public fun countTo(n: Int): (T) -> Boolean { return { ++count; count <= n } } -deprecated("Use contains() function instead") +deprecated("Use contains() function instead", ReplaceWith("contains(item)")) public fun Iterable.containsItem(item : T) : Boolean = contains(item) -deprecated("Use sortBy() instead") +deprecated("Use sortBy() instead", ReplaceWith("sortBy(comparator)")) public fun Iterable.sort(comparator: java.util.Comparator) : List = sortBy(comparator) -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val Array<*>.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val ByteArray.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val CharArray.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val ShortArray.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val IntArray.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val LongArray.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val FloatArray.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val DoubleArray.size: Int get() = size() -deprecated("Use size() instead") +deprecated("Use size() instead", ReplaceWith("size()")) public val BooleanArray.size: Int get() = size() -deprecated("Use compareValuesBy() instead") +deprecated("Use compareValuesBy() instead", ReplaceWith("compareValuesBy(a, b, *functions)")) public fun compareBy(a: T?, b: T?, vararg functions: (T) -> Comparable<*>?): Int = compareValuesBy(a, b, *functions) @@ -112,7 +112,7 @@ public fun compareBy(a: T?, b: T?, vararg functions: (T) -> Comparable * * @includeFunctionBody ../../test/collections/ListSpecificTest.kt first */ -deprecated("Use firstOrNull() function instead") +deprecated("Use firstOrNull() function instead", ReplaceWith("this.firstOrNull()")) public val List.first: T? get() = this.firstOrNull() @@ -135,7 +135,7 @@ public val List.last: T? * * @includeFunctionBody ../../test/collections/ListSpecificTest.kt head */ -deprecated("Use firstOrNull() function instead") +deprecated("Use firstOrNull() function instead", ReplaceWith("firstOrNull()")) public val List.head: T? get() = firstOrNull() @@ -144,39 +144,39 @@ public val List.head: T? * * @includeFunctionBody ../../test/collections/ListSpecificTest.kt tail */ -deprecated("Use drop(1) function call instead") +deprecated("Use drop(1) function call instead", ReplaceWith("drop(1)")) public val List.tail: List get() { return drop(1) } /** Returns true if this collection is empty */ -deprecated("Use isEmpty() function call instead") +deprecated("Use isEmpty() function call instead", ReplaceWith("isEmpty()")) public val Collection<*>.empty: Boolean get() = isEmpty() /** Returns the size of the collection */ -deprecated("Use size() function call instead") +deprecated("Use size() function call instead", ReplaceWith("size()")) public val Collection<*>.size: Int get() = size() /** Returns the size of the map */ -deprecated("Use size() function call instead") +deprecated("Use size() function call instead", ReplaceWith("size()")) public val Map<*, *>.size: Int get() = size() /** Returns true if this map is empty */ -deprecated("Use isEmpty() function call instead") +deprecated("Use isEmpty() function call instead", ReplaceWith("isEmpty()")) public val Map<*, *>.empty: Boolean get() = isEmpty() /** Returns true if this collection is not empty */ -deprecated("Use isNotEmpty() function call instead") +deprecated("Use isNotEmpty() function call instead", ReplaceWith("isNotEmpty()")) public val Collection<*>.notEmpty: Boolean get() = isNotEmpty() -deprecated("Use length() instead") +deprecated("Use length() instead", ReplaceWith("length()")) public val CharSequence.length: Int get() = length() diff --git a/libraries/stdlib/src/kotlin/deprecated/DeprecatedArrays.kt b/libraries/stdlib/src/kotlin/deprecated/DeprecatedArrays.kt index 7a07fecdb9c..cf4b82eadb6 100644 --- a/libraries/stdlib/src/kotlin/deprecated/DeprecatedArrays.kt +++ b/libraries/stdlib/src/kotlin/deprecated/DeprecatedArrays.kt @@ -2,40 +2,40 @@ package kotlin // deprecated to be removed after M12 -deprecated("Use arrayOf() instead.") +deprecated("Use arrayOf() instead.", ReplaceWith("arrayOf(*t)")) inline public fun array(vararg t : T) : Array = arrayOf(*t) suppress("NOTHING_TO_INLINE") -deprecated("Use doubleArrayOf() instead.") +deprecated("Use doubleArrayOf() instead.", ReplaceWith("doubleArrayOf(*content)")) inline public fun doubleArray(vararg content : Double) : DoubleArray = doubleArrayOf(*content) suppress("NOTHING_TO_INLINE") -deprecated("Use floatArrayOf() instead.") +deprecated("Use floatArrayOf() instead.", ReplaceWith("floatArrayOf(*content)")) inline public fun floatArray(vararg content : Float) : FloatArray = floatArrayOf(*content) suppress("NOTHING_TO_INLINE") -deprecated("Use longArrayOf() instead.") +deprecated("Use longArrayOf() instead.", ReplaceWith("longArrayOf(*content)")) inline public fun longArray(vararg content : Long) : LongArray = longArrayOf(*content) suppress("NOTHING_TO_INLINE") -deprecated("Use intArrayOf() instead.") +deprecated("Use intArrayOf() instead.", ReplaceWith("intArrayOf(*content)")) inline public fun intArray(vararg content : Int) : IntArray = intArrayOf(*content) suppress("NOTHING_TO_INLINE") -deprecated("Use charArrayOf() instead.") +deprecated("Use charArrayOf() instead.", ReplaceWith("charArrayOf(*content)")) inline public fun charArray(vararg content : Char) : CharArray = charArrayOf(*content) suppress("NOTHING_TO_INLINE") -deprecated("Use shortArrayOf() instead.") +deprecated("Use shortArrayOf() instead.", ReplaceWith("shortArrayOf(*content)")) inline public fun shortArray(vararg content : Short) : ShortArray = shortArrayOf(*content) suppress("NOTHING_TO_INLINE") -deprecated("Use byteArrayOf() instead.") +deprecated("Use byteArrayOf() instead.", ReplaceWith("byteArrayOf(*content)")) inline public fun byteArray(vararg content : Byte) : ByteArray = byteArrayOf(*content) suppress("NOTHING_TO_INLINE") -deprecated("Use booleanArrayOf() instead.") +deprecated("Use booleanArrayOf() instead.", ReplaceWith("booleanArrayOf(*content)")) inline public fun booleanArray(vararg content : Boolean) : BooleanArray = booleanArrayOf(*content) -deprecated("Use toTypedArray() instead.") +deprecated("Use toTypedArray() instead.", ReplaceWith("toTypedArray()")) inline public fun Collection.copyToArray(): Array = toTypedArray() \ No newline at end of file diff --git a/libraries/stdlib/src/kotlin/deprecated/DeprecatedJVM.kt b/libraries/stdlib/src/kotlin/deprecated/DeprecatedJVM.kt index 7457b91375d..0b804a2f061 100644 --- a/libraries/stdlib/src/kotlin/deprecated/DeprecatedJVM.kt +++ b/libraries/stdlib/src/kotlin/deprecated/DeprecatedJVM.kt @@ -19,13 +19,13 @@ package kotlin import java.util.* import java.util.concurrent.Callable -deprecated("Use sortedSetOf(...) instead") +deprecated("Use sortedSetOf(...) instead", ReplaceWith("sortedSetOf(*values)")) public fun sortedSet(vararg values: T): TreeSet = sortedSetOf(*values) -deprecated("Use sortedSetOf(...) instead") +deprecated("Use sortedSetOf(...) instead", ReplaceWith("sortedSetOf(comparator, *values)")) public fun sortedSet(comparator: Comparator, vararg values: T): TreeSet = sortedSetOf(comparator, *values) -deprecated("Use sortedMapOf(...) instead") +deprecated("Use sortedMapOf(...) instead", ReplaceWith("sortedMapOf(*values)")) public fun sortedMap(vararg values: Pair): SortedMap = sortedMapOf(*values) /** @@ -38,11 +38,11 @@ public /*inline*/ fun callable(action: () -> T): Callable { } } -deprecated("Use length() instead") +deprecated("Use length() instead", ReplaceWith("length()")) public val String.size: Int get() = length() -deprecated("Use length() instead") +deprecated("Use length() instead", ReplaceWith("length()")) public val CharSequence.size: Int get() = length() diff --git a/libraries/stdlib/src/kotlin/deprecated/DeprecatedStrings.kt b/libraries/stdlib/src/kotlin/deprecated/DeprecatedStrings.kt index 28cbd91caa8..e2fde0fbc87 100644 --- a/libraries/stdlib/src/kotlin/deprecated/DeprecatedStrings.kt +++ b/libraries/stdlib/src/kotlin/deprecated/DeprecatedStrings.kt @@ -1,113 +1,113 @@ package kotlin -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun Array.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun BooleanArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun ByteArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun CharArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun DoubleArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun FloatArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun IntArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun LongArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun ShortArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun Iterable.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinToString() instead") +deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)")) public fun Sequence.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String { return joinToString(separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun Array.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun BooleanArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun ByteArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun CharArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun DoubleArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun FloatArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun IntArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun LongArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun ShortArray.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun Iterable.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } -deprecated("Use joinTo() instead") +deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)")) public fun Sequence.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit { joinTo(buffer, separator, prefix, postfix, limit, truncated) } diff --git a/libraries/stdlib/src/kotlin/dom/Dom.kt b/libraries/stdlib/src/kotlin/dom/Dom.kt index 708b96584be..aba6d55b467 100644 --- a/libraries/stdlib/src/kotlin/dom/Dom.kt +++ b/libraries/stdlib/src/kotlin/dom/Dom.kt @@ -101,7 +101,7 @@ public fun Document?.elements(namespaceUri: String, localName: String): List = if (this == null) emptyList() else NodeListAsList(this) -deprecated("use asList instead") +deprecated("use asList instead", ReplaceWith("asList()")) public fun NodeList?.toList(): List = asList() public fun NodeList?.toElementList(): List { @@ -268,8 +268,8 @@ private class PreviousSiblings(private var node: Node) : Iterable { } /** Returns true if this node is a Text node or a CDATA node */ -deprecated("use property isText instead") -public fun Node.isText() : Boolean = nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE +deprecated("use property isText instead", ReplaceWith("isText")) +public fun Node.isText() : Boolean = isText /** * it is *true* when [Node.nodeType] is TEXT_NODE or CDATA_SECTION_NODE diff --git a/libraries/stdlib/src/kotlin/text/Strings.kt b/libraries/stdlib/src/kotlin/text/Strings.kt index b673fd56f6f..7aa85d9892a 100644 --- a/libraries/stdlib/src/kotlin/text/Strings.kt +++ b/libraries/stdlib/src/kotlin/text/Strings.kt @@ -79,10 +79,10 @@ public fun String.trimStart(vararg chars: Char): String = trimStart { it in char */ public fun String.trimEnd(vararg chars: Char): String = trimEnd { it in chars } -deprecated("Use removePrefix() instead") +deprecated("Use removePrefix() instead", ReplaceWith("removePrefix(prefix)")) public fun String.trimLeading(prefix: String): String = removePrefix(prefix) -deprecated("Use removeSuffix() instead") +deprecated("Use removeSuffix() instead", ReplaceWith("removeSuffix(postfix)")) public fun String.trimTrailing(postfix: String): String = removeSuffix(postfix) /** @@ -95,7 +95,7 @@ public fun String.trim(): String = trim { it.isWhitespace() } */ public fun String.trimStart(): String = trimStart { it.isWhitespace() } -deprecated("Use trimStart instead.") +deprecated("Use trimStart instead.", ReplaceWith("trimStart()")) public fun String.trimLeading(): String = trimStart { it.isWhitespace() } /** @@ -103,7 +103,7 @@ public fun String.trimLeading(): String = trimStart { it.isWhitespace() } */ public fun String.trimEnd(): String = trimEnd { it.isWhitespace() } -deprecated("Use trimEnd instead.") +deprecated("Use trimEnd instead.", ReplaceWith("trimEnd()")) public fun String.trimTrailing(): String = trimEnd { it.isWhitespace() } /** diff --git a/libraries/stdlib/src/kotlin/text/StringsJVM.kt b/libraries/stdlib/src/kotlin/text/StringsJVM.kt index 270f9da5f2b..b7e4532f4f5 100644 --- a/libraries/stdlib/src/kotlin/text/StringsJVM.kt +++ b/libraries/stdlib/src/kotlin/text/StringsJVM.kt @@ -32,7 +32,7 @@ private fun String.nativeLastIndexOf(str: String, fromIndex: Int): Int = (this a /** * Compares this string to another string, ignoring case considerations. */ -deprecated("Use equals(anotherString, ignoreCase = true) instead") +deprecated("Use equals(anotherString, ignoreCase = true) instead", ReplaceWith("equals(anotherString, ignoreCase = true)")) public fun String.equalsIgnoreCase(anotherString: String): Boolean = equals(anotherString, ignoreCase = true) /** diff --git a/libraries/stdlib/src/kotlin/util/Ordering.kt b/libraries/stdlib/src/kotlin/util/Ordering.kt index 92302684796..be7409162b5 100644 --- a/libraries/stdlib/src/kotlin/util/Ordering.kt +++ b/libraries/stdlib/src/kotlin/util/Ordering.kt @@ -64,7 +64,7 @@ public fun compareBy(vararg functions: (T) -> Comparable<*>?): Comparator /** * Creates a comparator using the sequence of functions to calculate a result of comparison. */ -deprecated("Use compareBy() instead") +deprecated("Use compareBy() instead", ReplaceWith("compareBy(*functions)")) public fun comparator(vararg functions: (T) -> Comparable<*>?): Comparator = compareBy(*functions) /**