Make all remaining deprecations to be errors.

This commit is contained in:
Ilya Gorbunov
2016-01-26 22:11:56 +03:00
parent 263e1b4b5d
commit d46501e11b
19 changed files with 144 additions and 193 deletions
@@ -983,7 +983,7 @@ public inline fun <T, K, V, M : MutableMap<in K, in V>> Iterable<T>.associateTo(
/**
* Returns an [ArrayList] of all elements.
*/
@Deprecated("Use toMutableList instead or toCollection(ArrayList()) if you need ArrayList's ensureCapacity and trimToSize.", ReplaceWith("toCollection(arrayListOf())"))
@Deprecated("Use toMutableList instead or toCollection(ArrayList()) if you need ArrayList's ensureCapacity and trimToSize.", ReplaceWith("toCollection(arrayListOf())"), level = DeprecationLevel.ERROR)
public fun <T> Collection<T>.toArrayList(): ArrayList<T> {
return ArrayList(this)
}
@@ -991,10 +991,10 @@ public fun <T> Collection<T>.toArrayList(): ArrayList<T> {
/**
* Returns an [ArrayList] of all elements.
*/
@Deprecated("Use toMutableList instead or toCollection(ArrayList()) if you need ArrayList's ensureCapacity and trimToSize.", ReplaceWith("toCollection(arrayListOf())"))
@Deprecated("Use toMutableList instead or toCollection(ArrayList()) if you need ArrayList's ensureCapacity and trimToSize.", ReplaceWith("toCollection(arrayListOf())"), level = DeprecationLevel.ERROR)
public fun <T> Iterable<T>.toArrayList(): ArrayList<T> {
if (this is Collection<T>)
return this.toArrayList()
return ArrayList(this)
return toCollection(ArrayList<T>())
}
@@ -1026,23 +1026,23 @@ public fun <T> Iterable<T>.toList(): List<T> {
* Returns a [Map] containing the values provided by [transform] and indexed by [selector] functions applied to elements of the given collection.
* If any two elements would have the same key returned by [selector] the last one gets added to the map.
*/
@Deprecated("Use associateBy instead.", ReplaceWith("associateBy(selector, transform)"))
@Deprecated("Use associateBy instead.", ReplaceWith("associateBy(selector, transform)"), level = DeprecationLevel.ERROR)
public inline fun <T, K, V> Iterable<T>.toMap(selector: (T) -> K, transform: (T) -> V): Map<K, V> {
return associateBy(selector, transform)
}
@Deprecated("Use associate instead.", ReplaceWith("associate(transform)"))
@Deprecated("Use associate instead.", ReplaceWith("associate(transform)"), level = DeprecationLevel.ERROR)
@kotlin.jvm.JvmName("toMapOfPairs")
public inline fun <T, K, V> Iterable<T>.toMap(transform: (T) -> Pair<K, V>): Map<K, V> {
return associate(transform)
}
@Deprecated("Use associateBy instead.", ReplaceWith("associateBy(selector)"))
@Deprecated("Use associateBy instead.", ReplaceWith("associateBy(selector)"), level = DeprecationLevel.ERROR)
public inline fun <T, K> Iterable<T>.toMapBy(selector: (T) -> K): Map<K, T> {
return associateBy(selector)
}
@Deprecated("Use associateBy instead.", ReplaceWith("associateBy(selector, transform)"))
@Deprecated("Use associateBy instead.", ReplaceWith("associateBy(selector, transform)"), level = DeprecationLevel.ERROR)
public inline fun <T, K, V> Iterable<T>.toMapBy(selector: (T) -> K, transform: (T) -> V): Map<K, V> {
return associateBy(selector, transform)
}