diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt index 758917e3008..b790da5c923 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt @@ -3,8 +3,6 @@ package pack import java.util.ArrayList import java.util.regex.Pattern -import kotlin.util.* - class C{ public fun foo(){ val items : Collection = java.util.Collections.singleton(Item())!! diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt index b11c83cf342..bc6f20f3374 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt @@ -1,4 +1,3 @@ -import kotlin.util.* import java.io.* import java.util.* diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/Kt1149.kt b/compiler/testData/codegen/boxWithStdlib/regressions/Kt1149.kt index 7738799710e..2fd0d29e972 100644 --- a/compiler/testData/codegen/boxWithStdlib/regressions/Kt1149.kt +++ b/compiler/testData/codegen/boxWithStdlib/regressions/Kt1149.kt @@ -1,7 +1,6 @@ package test.regressions.kt1149 import java.util.ArrayList -import kotlin.util.* public interface SomeTrait { fun foo() diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt789.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt789.kt index 9ce0845893f..dda3e45d21f 100644 --- a/compiler/testData/codegen/boxWithStdlib/regressions/kt789.kt +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt789.kt @@ -2,8 +2,6 @@ package foo import java.util.*; -import kotlin.util.* - fun box() : String { val a = ArrayList(); a.add(1) diff --git a/idea/testData/editor/optimizeImports/UnusedImports.kt b/idea/testData/editor/optimizeImports/UnusedImports.kt index e8f7a937745..10858936de2 100644 --- a/idea/testData/editor/optimizeImports/UnusedImports.kt +++ b/idea/testData/editor/optimizeImports/UnusedImports.kt @@ -8,7 +8,7 @@ import kotlin.test.asserter import kotlin.test.Asserter import kotlin.Charsets import kotlin.Assertions -import kotlin.util.measureTimeMillis +import kotlin.system.measureTimeMillis class Action { fun test() { diff --git a/idea/testData/editor/optimizeImports/UnusedImports.kt.after b/idea/testData/editor/optimizeImports/UnusedImports.kt.after index 53e4911b840..de9e03043f6 100644 --- a/idea/testData/editor/optimizeImports/UnusedImports.kt.after +++ b/idea/testData/editor/optimizeImports/UnusedImports.kt.after @@ -1,6 +1,6 @@ import java.util.ArrayList import java.util.HashMap -import kotlin.util.measureTimeMillis +import kotlin.system.measureTimeMillis class Action { fun test() { diff --git a/idea/testData/quickfix.special/deprecatedSymbolUsage/memberInCompiledClass.kt b/idea/testData/quickfix.special/deprecatedSymbolUsage/memberInCompiledClass.kt index 110af59ade9..ce68fc403b7 100644 --- a/idea/testData/quickfix.special/deprecatedSymbolUsage/memberInCompiledClass.kt +++ b/idea/testData/quickfix.special/deprecatedSymbolUsage/memberInCompiledClass.kt @@ -3,5 +3,5 @@ import kotlin.text.Regex fun foo(regex: Regex) { - regex.hasMatch("") + regex.containsMatchIn("") } \ No newline at end of file diff --git a/libraries/stdlib/src/kotlin/text/StringBuilder.kt b/libraries/stdlib/src/kotlin/text/StringBuilder.kt index 05efe200ce8..4566a5f6846 100644 --- a/libraries/stdlib/src/kotlin/text/StringBuilder.kt +++ b/libraries/stdlib/src/kotlin/text/StringBuilder.kt @@ -3,12 +3,6 @@ package kotlin.text -/** - * Builds newly created StringBuilder using provided body. - */ -@Deprecated("Use StringBuilder().apply { body } or use buildString { body } if you need String as a result.", ReplaceWith("StringBuilder().apply(body)")) -public inline fun StringBuilder(body: StringBuilder.() -> Unit): StringBuilder = StringBuilder().apply(body) - /** * Builds new string by populating newly created [StringBuilder] using provided [builderAction] and then converting it to [String]. */ diff --git a/libraries/stdlib/src/kotlin/text/StringsJVM.kt b/libraries/stdlib/src/kotlin/text/StringsJVM.kt index f817560cedb..99b2ccdf510 100644 --- a/libraries/stdlib/src/kotlin/text/StringsJVM.kt +++ b/libraries/stdlib/src/kotlin/text/StringsJVM.kt @@ -290,17 +290,6 @@ public fun String.contentEquals(charSequence: CharSequence): Boolean = (this as */ public fun String.contentEquals(stringBuilder: StringBuffer): Boolean = (this as java.lang.String).contentEquals(stringBuilder) -/** - * Copies the characters from a substring of this string into the specified character array. - * @param srcBegin the start offset (inclusive) of the substring to copy. - * @param srcEnd the end offset (exclusive) of the substring to copy. - * @param dst the array to copy to. - * @param dstBegin the position in the array to copy to. - */ -@Deprecated("Use toCharArray() instead.", ReplaceWith("toCharArray(dst, dstBegin, srcBegin, srcEnd)")) -public fun String.getChars(srcBegin: Int, srcEnd: Int, dst: CharArray, dstBegin: Int): Unit = (this as java.lang.String).getChars(srcBegin, srcEnd, dst, dstBegin) - - /** * Returns a canonical representation for this string object. */ @@ -394,21 +383,6 @@ public fun String.toFloat(): Float = java.lang.Float.parseFloat(this) */ public fun String.toDouble(): Double = java.lang.Double.parseDouble(this) -/** - * Returns the list of all characters in this string. - */ -@Deprecated("Use toList() instead.", ReplaceWith("toList()")) -public fun String.toCharList(): List = toCharArray().toList() - -/** - * Returns a subsequence of this char sequence. - * - * @param start the start index (inclusive). - * @param end the end index (exclusive). - */ -@Deprecated("Use subSequence(start, end) instead.", ReplaceWith("subSequence(start, end)")) -public operator fun CharSequence.get(start: Int, end: Int): CharSequence = subSequence(start, end) - /** * Encodes the contents of this string using the specified character set and returns the resulting byte array. */ diff --git a/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt b/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt index bd0504d94db..f9f838a7b9f 100644 --- a/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt +++ b/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt @@ -111,18 +111,12 @@ public class Regex internal constructor(private val nativePattern: Pattern) { /** The set of options that were used to create this regular expression. */ public val options: Set = fromInt(nativePattern.flags()) - @Deprecated("To get the Matcher from java.util.regex.Pattern use toPattern to convert string to Pattern, or migrate to Regex API", ReplaceWith("toPattern().matcher(input)"), DeprecationLevel.ERROR) - public fun matcher(input: CharSequence): Matcher = nativePattern.matcher(input) - /** Indicates whether the regular expression matches the entire [input]. */ public fun matches(input: CharSequence): Boolean = nativePattern.matcher(input).matches() /** Indicates whether the regular expression can find at least one match in the specified [input]. */ public fun containsMatchIn(input: CharSequence): Boolean = nativePattern.matcher(input).find() - @Deprecated("Use containsMatchIn() or 'in' operator instead.", ReplaceWith("this in input"), DeprecationLevel.ERROR) - public fun hasMatch(input: CharSequence): Boolean = containsMatchIn(input) - /** * Returns the first match of a regular expression in the [input], beginning at the specified [startIndex]. * @@ -131,17 +125,11 @@ public class Regex internal constructor(private val nativePattern: Pattern) { */ public fun find(input: CharSequence, startIndex: Int = 0): MatchResult? = nativePattern.matcher(input).findNext(startIndex, input) - @Deprecated("Use find() instead.", ReplaceWith("find(input, startIndex)"), DeprecationLevel.ERROR) - public fun match(input: CharSequence, startIndex: Int = 0): MatchResult? = find(input, startIndex) - /** * Returns a sequence of all occurrences of a regular expression within the [input] string, beginning at the specified [startIndex]. */ public fun findAll(input: CharSequence, startIndex: Int = 0): Sequence = generateSequence({ find(input, startIndex) }, { match -> match.next() }) - @Deprecated("Use findAll() instead.", ReplaceWith("findAll(input, startIndex)"), DeprecationLevel.ERROR) - public fun matchAll(input: CharSequence, startIndex: Int = 0): Sequence = findAll(input, startIndex) - /** * Attempts to match the entire [input] CharSequence against the pattern. * diff --git a/libraries/stdlib/src/kotlin/util/SystemJVM.kt b/libraries/stdlib/src/kotlin/util/SystemJVM.kt deleted file mode 100644 index 86b6eefe575..00000000000 --- a/libraries/stdlib/src/kotlin/util/SystemJVM.kt +++ /dev/null @@ -1,22 +0,0 @@ -@file:kotlin.jvm.JvmName("TimingUtilsKt") -package kotlin.util - -/** - * Executes the given block and returns elapsed time in milliseconds. - */ -@Deprecated("Use measureTimeMillis from kotlin.system instead.", ReplaceWith("kotlin.system.measureTimeMillis(block)", "kotlin.system")) -public fun measureTimeMillis(block: () -> Unit) : Long { - val start = System.currentTimeMillis() - block() - return System.currentTimeMillis() - start -} - -/** - * Executes the given block and returns elapsed time in nanoseconds. - */ -@Deprecated("Use measureTimeNano from kotlin.system instead.", ReplaceWith("kotlin.system.measureTimeNano(block)", "kotlin.system")) -public fun measureTimeNano(block: () -> Unit) : Long { - val start = System.nanoTime() - block() - return System.nanoTime() - start -}