diff --git a/js/js.libraries/src/core/javautilCode.kt b/js/js.libraries/src/core/javautilCode.kt index c2f415dc087..80ee60c6c27 100644 --- a/js/js.libraries/src/core/javautilCode.kt +++ b/js/js.libraries/src/core/javautilCode.kt @@ -17,16 +17,16 @@ package java.util public fun HashSet(c: Collection): HashSet - = HashSet(c.size()).apply { addAll(c) } + = HashSet(c.size).apply { addAll(c) } public fun LinkedHashSet(c: Collection): HashSet - = LinkedHashSet(c.size()).apply { addAll(c) } + = LinkedHashSet(c.size).apply { addAll(c) } public fun HashMap(m: Map): HashMap - = HashMap(m.size()).apply { putAll(m) } + = HashMap(m.size).apply { putAll(m) } public fun LinkedHashMap(m: Map): LinkedHashMap - = LinkedHashMap(m.size()).apply { putAll(m) } + = LinkedHashMap(m.size).apply { putAll(m) } public fun ArrayList(c: Collection): ArrayList = ArrayList().apply { asDynamic().array = c.toTypedArray() } // black dynamic magic diff --git a/js/js.libraries/src/core/javautilCollections.kt b/js/js.libraries/src/core/javautilCollections.kt index f20648b3c28..ffa4db8641a 100644 --- a/js/js.libraries/src/core/javautilCollections.kt +++ b/js/js.libraries/src/core/javautilCollections.kt @@ -16,7 +16,7 @@ public object Collections { @Deprecated("Use list.reverse() instead.", ReplaceWith("list.reverse()")) public fun reverse(list: MutableList): Unit { - val size = list.size() + val size = list.size for (i in 0..(size / 2) - 1) { val i2 = size - i - 1 val tmp = list[i] diff --git a/js/js.libraries/src/core/kotlin.kt b/js/js.libraries/src/core/kotlin.kt index 527ea3148b8..de32e8b8baf 100644 --- a/js/js.libraries/src/core/kotlin.kt +++ b/js/js.libraries/src/core/kotlin.kt @@ -180,7 +180,7 @@ internal fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): internal fun arrayPlusCollection(array: dynamic, collection: Collection): dynamic { val result = array.slice(0) - result.length += collection.size() + result.length += collection.size var index: Int = array.length for (element in collection) result[index++] = element return result diff --git a/js/js.libraries/src/core/regex.kt b/js/js.libraries/src/core/regex.kt index d2820711964..edcc96394e5 100644 --- a/js/js.libraries/src/core/regex.kt +++ b/js/js.libraries/src/core/regex.kt @@ -56,7 +56,7 @@ public class Regex(pattern: String, options: Set) { public fun matches(input: CharSequence): Boolean { nativePattern.reset() val match = nativePattern.exec(input.toString()) - return match != null && (match as RegExpMatch).index == 0 && nativePattern.lastIndex == input.length() + return match != null && (match as RegExpMatch).index == 0 && nativePattern.lastIndex == input.length } /** Indicates whether the regular expression can find at least one match in the specified [input]. */ @@ -114,7 +114,7 @@ public class Regex(pattern: String, options: Set) { if (match == null) return input.toString() var lastStart = 0 - val length = input.length() + val length = input.length val sb = StringBuilder(length) do { val foundMatch = match!! @@ -156,7 +156,7 @@ public class Regex(pattern: String, options: Set) { result.add(input.subSequence(lastStart, match.range.start).toString()) lastStart = match.range.endInclusive + 1 } - result.add(input.subSequence(lastStart, input.length()).toString()) + result.add(input.subSequence(lastStart, input.length).toString()) return result } diff --git a/js/js.libraries/src/core/stringsCode.kt b/js/js.libraries/src/core/stringsCode.kt index 23264b4db98..eec69707aaa 100644 --- a/js/js.libraries/src/core/stringsCode.kt +++ b/js/js.libraries/src/core/stringsCode.kt @@ -12,7 +12,7 @@ public fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boole if (!ignoreCase) return nativeStartsWith(prefix, 0) else - return regionMatches(0, prefix, 0, prefix.length(), ignoreCase) + return regionMatches(0, prefix, 0, prefix.length, ignoreCase) } /** @@ -22,7 +22,7 @@ public fun String.startsWith(prefix: String, startIndex: Int, ignoreCase: Boolea if (!ignoreCase) return nativeStartsWith(prefix, startIndex) else - return regionMatches(startIndex, prefix, 0, prefix.length(), ignoreCase) + return regionMatches(startIndex, prefix, 0, prefix.length, ignoreCase) } /** @@ -32,17 +32,17 @@ public fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean if (!ignoreCase) return nativeEndsWith(suffix) else - return regionMatches(length() - suffix.length(), suffix, 0, suffix.length(), ignoreCase) + return regionMatches(length - suffix.length, suffix, 0, suffix.length, ignoreCase) } public inline fun String.matches(regex : String) : Boolean { val result = this.match(regex) - return result != null && result.size() > 0 + return result != null && result.size > 0 } -public fun CharSequence.isBlank(): Boolean = length() == 0 || (if (this is String) this else this.toString()).matches("^[\\s\\xA0]+$") +public fun CharSequence.isBlank(): Boolean = length == 0 || (if (this is String) this else this.toString()).matches("^[\\s\\xA0]+$") public fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean = if (this == null) diff --git a/libraries/stdlib/src/kotlin/collections/DeprecatedBuiltins.kt b/libraries/stdlib/src/kotlin/collections/DeprecatedBuiltins.kt deleted file mode 100644 index 4a012a8447e..00000000000 --- a/libraries/stdlib/src/kotlin/collections/DeprecatedBuiltins.kt +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:kotlin.jvm.JvmName("DeprecatedBuiltinsKt") - -package kotlin - -@Deprecated("Use property 'message' instead", ReplaceWith("this.message")) -public inline fun Throwable.getMessage(): String? = message - -@Deprecated("Use property 'cause' instead", ReplaceWith("this.cause")) -public inline fun Throwable.getCause(): Throwable? = cause - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun Array<*>.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun ByteArray.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun CharArray.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun ShortArray.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun IntArray.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun LongArray.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun FloatArray.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun DoubleArray.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("this.size")) -public inline fun BooleanArray.size() = size diff --git a/libraries/stdlib/src/kotlin/collections/MutableCollections.kt b/libraries/stdlib/src/kotlin/collections/MutableCollections.kt index 8817e80fc21..6b3280d345a 100644 --- a/libraries/stdlib/src/kotlin/collections/MutableCollections.kt +++ b/libraries/stdlib/src/kotlin/collections/MutableCollections.kt @@ -40,53 +40,6 @@ public fun <@kotlin.internal.OnlyInputTypes T> MutableCollection.removeAl */ public fun <@kotlin.internal.OnlyInputTypes T> MutableCollection.retainAll(elements: Collection): Boolean = (this as MutableCollection).retainAll(elements) - -@Deprecated("Use operator 'get' instead", ReplaceWith("this[index]")) -public fun CharSequence.charAt(index: Int): Char = this[index] - -@Deprecated("Use property 'size' instead", ReplaceWith("size")) -public inline fun Collection<*>.size() = size - -@Deprecated("Use property 'size' instead", ReplaceWith("size")) -public inline fun Map<*, *>.size() = size - -@Deprecated("Use property 'key' instead", ReplaceWith("key")) -public fun Map.Entry.getKey(): K = key - - -@Deprecated("Use property 'value' instead.", ReplaceWith("value")) -public fun Map.Entry.getValue(): V = value - -@Deprecated("Use 'removeAt' instead.", ReplaceWith("removeAt(index)")) -public fun MutableList.remove(index: Int): E = removeAt(index) - - - - -@Deprecated("Use property 'length' instead.", ReplaceWith("length")) -public fun CharSequence.length(): Int = length - -@Deprecated("Use property 'keys' instead.", ReplaceWith("keys")) -public inline fun Map.keySet(): Set = keys - -@kotlin.jvm.JvmName("mutableKeys") -@Deprecated("Use property 'keys' instead.", ReplaceWith("keys")) -public fun MutableMap.keySet(): MutableSet = keys - -@Deprecated("Use property 'entries' instead.", ReplaceWith("entries")) -public inline fun Map.entrySet(): Set> = entries - -@kotlin.jvm.JvmName("mutableEntrySet") -@Deprecated("Use property 'entries' instead.", ReplaceWith("entries")) -public fun MutableMap.entrySet(): MutableSet> = entries - -@Deprecated("Use property 'values' instead.", ReplaceWith("values")) -public inline fun Map.values(): Collection = values - -@kotlin.jvm.JvmName("mutableValues") -@Deprecated("Use property 'values' instead.", ReplaceWith("values")) -public fun MutableMap.values(): MutableCollection = values - /** * Adds the specified [element] to this mutable collection. */ diff --git a/libraries/stdlib/src/kotlin/enums/Enums.kt b/libraries/stdlib/src/kotlin/enums/Enums.kt deleted file mode 100644 index df1e7335825..00000000000 --- a/libraries/stdlib/src/kotlin/enums/Enums.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@file:kotlin.jvm.JvmMultifileClass -@file:kotlin.jvm.JvmName("EnumsKt") - -package kotlin - -@Deprecated("Use property ''name'' instead", ReplaceWith("this.name")) -public inline fun Enum<*>.name() = name - -@Deprecated("Use property ''ordinal'' instead", ReplaceWith("this.ordinal")) -public inline fun Enum<*>.ordinal() = ordinal - diff --git a/libraries/stdlib/src/kotlin/text/CharJVM.kt b/libraries/stdlib/src/kotlin/text/CharJVM.kt index 6e2679a493c..a8b58a6e00b 100644 --- a/libraries/stdlib/src/kotlin/text/CharJVM.kt +++ b/libraries/stdlib/src/kotlin/text/CharJVM.kt @@ -99,24 +99,11 @@ public fun Char.isTitleCase(): Boolean = Character.isTitleCase(this) */ public fun Char.toTitleCase(): Char = Character.toTitleCase(this) -/** - * Returns a value indicating a character's general category. - */ -@Deprecated("Use 'category' property instead.", ReplaceWith("category")) -public fun Char.category(): CharCategory = category - /** * Returns a value indicating a character's general category. */ public val Char.category: CharCategory get() = CharCategory.valueOf(Character.getType(this)) - -/** - * Returns the Unicode directionality property for the given character. - */ -@Deprecated("Use 'directionality' property instead.", ReplaceWith("directionality")) -public fun Char.directionality(): CharDirectionality = directionality - /** * Returns the Unicode directionality property for the given character. */ diff --git a/libraries/stdlib/src/kotlin/util/Numbers.kt b/libraries/stdlib/src/kotlin/util/Numbers.kt index 5e05689d42e..acbc942ce90 100644 --- a/libraries/stdlib/src/kotlin/util/Numbers.kt +++ b/libraries/stdlib/src/kotlin/util/Numbers.kt @@ -33,22 +33,3 @@ public fun Double.isFinite(): Boolean = !isInfinite() && !isNaN() * Returns `true` if the argument is a finite floating-point value; returns `false` otherwise (for `NaN` and infinity arguments). */ public fun Float.isFinite(): Boolean = !isInfinite() && !isNaN() - - -@Deprecated("Use toInt() instead.", ReplaceWith("toInt()")) -public fun Number.intValue(): Int = toInt() - -@Deprecated("Use toLong() instead.", ReplaceWith("toLong()")) -public fun Number.longValue(): Long = toLong() - -@Deprecated("Use toShort() instead.", ReplaceWith("toShort()")) -public fun Number.shortValue(): Short = toShort() - -@Deprecated("Use toByte() instead.", ReplaceWith("toByte()")) -public fun Number.byteValue(): Byte = toByte() - -@Deprecated("Use toDouble() instead.", ReplaceWith("toDouble()")) -public fun Number.doubleValue(): Double = toDouble() - -@Deprecated("Use toFloat() instead.", ReplaceWith("toFloat()")) -public fun Number.floatValue(): Float = toFloat() diff --git a/libraries/stdlib/src/kotlin/util/StandardJVM.kt b/libraries/stdlib/src/kotlin/util/StandardJVM.kt index 26193b510cd..803613983ed 100644 --- a/libraries/stdlib/src/kotlin/util/StandardJVM.kt +++ b/libraries/stdlib/src/kotlin/util/StandardJVM.kt @@ -30,13 +30,6 @@ public fun Throwable.printStackTrace(stream: PrintStream): Unit { jlt.printStackTrace(stream) } -/** - * Returns the list of stack trace elements in a Kotlin stack trace. - */ -@Deprecated("Use 'stackTrace' property instead.", ReplaceWith("stackTrace")) -@JvmName("getStackTraceDeprecated") -public inline fun Throwable.getStackTrace(): Array = stackTrace - /** * Returns an array of stack trace elements representing the stack trace * pertaining to this throwable.