Drop deprecated stuff
This commit is contained in:
@@ -1,106 +0,0 @@
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
@Deprecated("Use listOf(...) or arrayListOf(...) instead", ReplaceWith("arrayListOf(*values)"))
|
||||
public fun arrayList<T>(vararg values: T): ArrayList<T> = arrayListOf(*values)
|
||||
|
||||
@Deprecated("Use setOf(...) or hashSetOf(...) instead", ReplaceWith("hashSetOf(*values)"))
|
||||
public fun hashSet<T>(vararg values: T): HashSet<T> = hashSetOf(*values)
|
||||
|
||||
@Deprecated("Use mapOf(...) or hashMapOf(...) instead", ReplaceWith("hashMapOf(*values)"))
|
||||
public fun <K, V> hashMap(vararg values: Pair<K, V>): HashMap<K, V> = hashMapOf(*values)
|
||||
|
||||
@Deprecated("Use listOf(...) or linkedListOf(...) instead", ReplaceWith("linkedListOf(*values)"))
|
||||
public fun linkedList<T>(vararg values: T): LinkedList<T> = linkedListOf(*values)
|
||||
|
||||
@Deprecated("Use linkedMapOf(...) instead", ReplaceWith("linkedMapOf(*values)"))
|
||||
public fun <K, V> linkedMap(vararg values: Pair<K, V>): LinkedHashMap<K, V> = linkedMapOf(*values)
|
||||
|
||||
/** Copies all characters into a [[Collection] */
|
||||
@Deprecated("Use toList() instead.", ReplaceWith("toList()"))
|
||||
public fun String.toCollection(): Collection<Char> = toCollection(ArrayList<Char>(this.length()))
|
||||
|
||||
|
||||
/**
|
||||
* A helper method for creating a [[Runnable]] from a function
|
||||
*/
|
||||
@Deprecated("Use SAM constructor: Runnable(...)", ReplaceWith("Runnable(action)"))
|
||||
public /*inline*/ fun runnable(action: () -> Unit): Runnable = Runnable(action)
|
||||
|
||||
@Deprecated("Use forEachIndexed instead.", ReplaceWith("forEachIndexed(operation)"))
|
||||
public inline fun <T> List<T>.forEachWithIndex(operation: (Int, T) -> Unit): Unit = forEachIndexed(operation)
|
||||
|
||||
@Deprecated("Function with undefined semantic")
|
||||
public fun <T> countTo(n: Int): (T) -> Boolean {
|
||||
var count = 0
|
||||
return { ++count; count <= n }
|
||||
}
|
||||
|
||||
@Deprecated("Use contains() function instead", ReplaceWith("contains(item)"))
|
||||
public fun <T> Iterable<T>.containsItem(item : T) : Boolean = contains(item)
|
||||
|
||||
@Deprecated("Use sortBy() instead", ReplaceWith("sortedWith(comparator)"))
|
||||
public fun <T> Iterable<T>.sort(comparator: java.util.Comparator<T>) : List<T> = sortedWith(comparator)
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val Array<*>.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val ByteArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val CharArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val ShortArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val IntArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val LongArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val FloatArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val DoubleArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use size() instead", ReplaceWith("size()"))
|
||||
public val BooleanArray.size: Int get() = size()
|
||||
|
||||
@Deprecated("Use compareValuesBy() instead", ReplaceWith("compareValuesBy(a, b, *functions)"))
|
||||
public fun <T : Any> compareBy(a: T?, b: T?, vararg functions: (T) -> Comparable<*>?): Int = compareValuesBy(a, b, *functions)
|
||||
|
||||
|
||||
/** Returns true if this collection is empty */
|
||||
@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", ReplaceWith("size()"))
|
||||
public val Collection<*>.size: Int
|
||||
get() = size()
|
||||
|
||||
|
||||
/** Returns the size of the map */
|
||||
@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", ReplaceWith("isEmpty()"))
|
||||
public val Map<*, *>.empty: Boolean
|
||||
get() = isEmpty()
|
||||
|
||||
/** Returns true if this collection is not empty */
|
||||
@Deprecated("Use isNotEmpty() function call instead", ReplaceWith("isNotEmpty()"))
|
||||
public val Collection<*>.notEmpty: Boolean
|
||||
get() = isNotEmpty()
|
||||
|
||||
@Deprecated("Use length() instead", ReplaceWith("length()"))
|
||||
public val CharSequence.length: Int
|
||||
get() = length()
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package kotlin
|
||||
|
||||
// deprecated to be removed after M12
|
||||
|
||||
@Deprecated("Use arrayOf() instead.", ReplaceWith("arrayOf(*t)"))
|
||||
inline public fun <reified T> array(vararg t : T) : Array<T> = arrayOf(*t)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@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.", ReplaceWith("floatArrayOf(*content)"))
|
||||
inline public fun floatArray(vararg content : Float) : FloatArray = floatArrayOf(*content)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@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.", ReplaceWith("intArrayOf(*content)"))
|
||||
inline public fun intArray(vararg content : Int) : IntArray = intArrayOf(*content)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@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.", ReplaceWith("shortArrayOf(*content)"))
|
||||
inline public fun shortArray(vararg content : Short) : ShortArray = shortArrayOf(*content)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@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.", ReplaceWith("booleanArrayOf(*content)"))
|
||||
inline public fun booleanArray(vararg content : Boolean) : BooleanArray = booleanArrayOf(*content)
|
||||
|
||||
@Deprecated("Use toTypedArray() instead.", ReplaceWith("toTypedArray()"))
|
||||
inline public fun <reified T> Collection<T>.copyToArray(): Array<T> = toTypedArray()
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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", ReplaceWith("sortedSetOf(*values)"))
|
||||
public fun sortedSet<T>(vararg values: T): TreeSet<T> = sortedSetOf(*values)
|
||||
|
||||
@Deprecated("Use sortedSetOf(...) instead", ReplaceWith("sortedSetOf(comparator, *values)"))
|
||||
public fun sortedSet<T>(comparator: Comparator<T>, vararg values: T): TreeSet<T> = sortedSetOf(comparator, *values)
|
||||
|
||||
@Deprecated("Use sortedMapOf(...) instead", ReplaceWith("sortedMapOf(*values)"))
|
||||
public fun <K, V> sortedMap(vararg values: Pair<K, V>): SortedMap<K, V> = sortedMapOf(*values)
|
||||
|
||||
/**
|
||||
* A helper method for creating a [[Callable]] from a function
|
||||
*/
|
||||
@Deprecated("Use SAM constructor: Callable(...)", ReplaceWith("Callable(action)", "java.util.concurrent.Callable"))
|
||||
public /*inline*/ fun <T> callable(action: () -> T): Callable<T> = Callable(action)
|
||||
|
||||
@Deprecated("Use length() instead", ReplaceWith("length()"))
|
||||
public val String.size: Int
|
||||
get() = length()
|
||||
|
||||
@Deprecated("Use length() instead", ReplaceWith("length()"))
|
||||
public val CharSequence.size: Int
|
||||
get() = length()
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
package kotlin
|
||||
|
||||
|
||||
@Deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)"))
|
||||
public fun <T> Array<out T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinToString(separator, prefix, postfix, limit, truncated)
|
||||
}
|
||||
|
||||
@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", 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", 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", 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", 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", 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", 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", 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", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)"))
|
||||
public fun <T> Iterable<T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinToString(separator, prefix, postfix, limit, truncated)
|
||||
}
|
||||
|
||||
@Deprecated("Use joinToString() instead", ReplaceWith("joinToString(separator, prefix, postfix, limit, truncated)"))
|
||||
public fun <T> Sequence<T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinToString(separator, prefix, postfix, limit, truncated)
|
||||
}
|
||||
|
||||
|
||||
@Deprecated("Use joinTo() instead", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)"))
|
||||
public fun <T> Array<out T>.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", 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", 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", 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", 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", 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", 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", 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", 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", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)"))
|
||||
public fun <T> Iterable<T>.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", ReplaceWith("joinTo(buffer, separator, prefix, postfix, limit, truncated)"))
|
||||
public fun <T> Sequence<T>.appendString(buffer: Appendable, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): Unit {
|
||||
joinTo(buffer, separator, prefix, postfix, limit, truncated)
|
||||
}
|
||||
Reference in New Issue
Block a user