diff --git a/libraries/stdlib/src/kotlin/Deprecated.kt b/libraries/stdlib/src/kotlin/Deprecated.kt index 6e7c6917ba4..051534570af 100644 --- a/libraries/stdlib/src/kotlin/Deprecated.kt +++ b/libraries/stdlib/src/kotlin/Deprecated.kt @@ -1,7 +1,6 @@ package kotlin import java.util.* -import java.util.concurrent.Callable deprecated("Use firstOrNull function instead.") public inline fun Array.find(predicate: (T) -> Boolean): T? = firstOrNull(predicate) @@ -21,28 +20,9 @@ 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 sortedSetOf(...) instead") -public fun sortedSet(vararg values: T): TreeSet = sortedSetOf(*values) - -deprecated("Use sortedSetOf(...) instead") -public fun sortedSet(comparator: Comparator, vararg values: T): TreeSet = sortedSetOf(comparator, *values) - -deprecated("Use sortedMapOf(...) instead") -public fun sortedMap(vararg values: Pair): SortedMap = sortedMapOf(*values) - deprecated("Use linkedMapOf(...) instead") public fun linkedMap(vararg values: Pair): LinkedHashMap = linkedMapOf(*values) -/** - * A helper method for creating a [[Callable]] from a function - */ -deprecated("Use SAM constructor: Callable(...)") -public /*inline*/ fun callable(action: () -> T): Callable { - return object: Callable { - public override fun call() = action() - } -} - /** * A helper method for creating a [[Runnable]] from a function */ diff --git a/libraries/stdlib/src/kotlin/DeprecatedJVM.kt b/libraries/stdlib/src/kotlin/DeprecatedJVM.kt new file mode 100644 index 00000000000..2f5930563b3 --- /dev/null +++ b/libraries/stdlib/src/kotlin/DeprecatedJVM.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2010-2014 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. + */ + +package kotlin + +import java.util.* +import java.util.concurrent.Callable + +deprecated("Use sortedSetOf(...) instead") +public fun sortedSet(vararg values: T): TreeSet = sortedSetOf(*values) + +deprecated("Use sortedSetOf(...) instead") +public fun sortedSet(comparator: Comparator, vararg values: T): TreeSet = sortedSetOf(comparator, *values) + +deprecated("Use sortedMapOf(...) instead") +public fun sortedMap(vararg values: Pair): SortedMap = sortedMapOf(*values) + +/** + * A helper method for creating a [[Callable]] from a function + */ +deprecated("Use SAM constructor: Callable(...)") +public /*inline*/ fun callable(action: () -> T): Callable { + return object: Callable { + public override fun call() = action() + } +}