InlineExposed usages are changed to PublishedApi

This commit is contained in:
Mikhael Bogdanov
2016-11-30 14:26:41 +01:00
parent 0f813d5cfe
commit 95a47e56f7
22 changed files with 45 additions and 91 deletions
-36
View File
@@ -5808,7 +5808,6 @@ public fun Array<out Short>.toShortArray(): ShortArray {
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <T, K, V> Array<out T>.associate(transform: (T) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5822,7 +5821,6 @@ public inline fun <T, K, V> Array<out T>.associate(transform: (T) -> Pair<K, V>)
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> ByteArray.associate(transform: (Byte) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5836,7 +5834,6 @@ public inline fun <K, V> ByteArray.associate(transform: (Byte) -> Pair<K, V>): M
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> ShortArray.associate(transform: (Short) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5850,7 +5847,6 @@ public inline fun <K, V> ShortArray.associate(transform: (Short) -> Pair<K, V>):
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> IntArray.associate(transform: (Int) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5864,7 +5860,6 @@ public inline fun <K, V> IntArray.associate(transform: (Int) -> Pair<K, V>): Map
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> LongArray.associate(transform: (Long) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5878,7 +5873,6 @@ public inline fun <K, V> LongArray.associate(transform: (Long) -> Pair<K, V>): M
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> FloatArray.associate(transform: (Float) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5892,7 +5886,6 @@ public inline fun <K, V> FloatArray.associate(transform: (Float) -> Pair<K, V>):
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> DoubleArray.associate(transform: (Double) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5906,7 +5899,6 @@ public inline fun <K, V> DoubleArray.associate(transform: (Double) -> Pair<K, V>
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> BooleanArray.associate(transform: (Boolean) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5920,7 +5912,6 @@ public inline fun <K, V> BooleanArray.associate(transform: (Boolean) -> Pair<K,
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> CharArray.associate(transform: (Char) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -5934,7 +5925,6 @@ public inline fun <K, V> CharArray.associate(transform: (Char) -> Pair<K, V>): M
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <T, K> Array<out T>.associateBy(keySelector: (T) -> K): Map<K, T> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, T>(capacity), keySelector)
}
@@ -5948,7 +5938,6 @@ public inline fun <T, K> Array<out T>.associateBy(keySelector: (T) -> K): Map<K,
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> ByteArray.associateBy(keySelector: (Byte) -> K): Map<K, Byte> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Byte>(capacity), keySelector)
}
@@ -5962,7 +5951,6 @@ public inline fun <K> ByteArray.associateBy(keySelector: (Byte) -> K): Map<K, By
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> ShortArray.associateBy(keySelector: (Short) -> K): Map<K, Short> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Short>(capacity), keySelector)
}
@@ -5976,7 +5964,6 @@ public inline fun <K> ShortArray.associateBy(keySelector: (Short) -> K): Map<K,
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> IntArray.associateBy(keySelector: (Int) -> K): Map<K, Int> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Int>(capacity), keySelector)
}
@@ -5990,7 +5977,6 @@ public inline fun <K> IntArray.associateBy(keySelector: (Int) -> K): Map<K, Int>
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> LongArray.associateBy(keySelector: (Long) -> K): Map<K, Long> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Long>(capacity), keySelector)
}
@@ -6004,7 +5990,6 @@ public inline fun <K> LongArray.associateBy(keySelector: (Long) -> K): Map<K, Lo
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> FloatArray.associateBy(keySelector: (Float) -> K): Map<K, Float> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Float>(capacity), keySelector)
}
@@ -6018,7 +6003,6 @@ public inline fun <K> FloatArray.associateBy(keySelector: (Float) -> K): Map<K,
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> DoubleArray.associateBy(keySelector: (Double) -> K): Map<K, Double> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Double>(capacity), keySelector)
}
@@ -6032,7 +6016,6 @@ public inline fun <K> DoubleArray.associateBy(keySelector: (Double) -> K): Map<K
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> BooleanArray.associateBy(keySelector: (Boolean) -> K): Map<K, Boolean> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Boolean>(capacity), keySelector)
}
@@ -6046,7 +6029,6 @@ public inline fun <K> BooleanArray.associateBy(keySelector: (Boolean) -> K): Map
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K> CharArray.associateBy(keySelector: (Char) -> K): Map<K, Char> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Char>(capacity), keySelector)
}
@@ -6059,7 +6041,6 @@ public inline fun <K> CharArray.associateBy(keySelector: (Char) -> K): Map<K, Ch
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <T, K, V> Array<out T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6072,7 +6053,6 @@ public inline fun <T, K, V> Array<out T>.associateBy(keySelector: (T) -> K, valu
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> ByteArray.associateBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6085,7 +6065,6 @@ public inline fun <K, V> ByteArray.associateBy(keySelector: (Byte) -> K, valueTr
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> ShortArray.associateBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6098,7 +6077,6 @@ public inline fun <K, V> ShortArray.associateBy(keySelector: (Short) -> K, value
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> IntArray.associateBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6111,7 +6089,6 @@ public inline fun <K, V> IntArray.associateBy(keySelector: (Int) -> K, valueTran
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> LongArray.associateBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6124,7 +6101,6 @@ public inline fun <K, V> LongArray.associateBy(keySelector: (Long) -> K, valueTr
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> FloatArray.associateBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6137,7 +6113,6 @@ public inline fun <K, V> FloatArray.associateBy(keySelector: (Float) -> K, value
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> DoubleArray.associateBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6150,7 +6125,6 @@ public inline fun <K, V> DoubleArray.associateBy(keySelector: (Double) -> K, val
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> BooleanArray.associateBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -6163,7 +6137,6 @@ public inline fun <K, V> BooleanArray.associateBy(keySelector: (Boolean) -> K, v
* The returned map preserves the entry iteration order of the original array.
*/
public inline fun <K, V> CharArray.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(size).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -11912,7 +11885,6 @@ public infix fun <R> CharArray.zip(other: Iterable<R>): List<Pair<Char, R>> {
*/
public inline fun <T, R, V> Array<out T>.zip(other: Iterable<R>, transform: (T, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -11927,7 +11899,6 @@ public inline fun <T, R, V> Array<out T>.zip(other: Iterable<R>, transform: (T,
*/
public inline fun <R, V> ByteArray.zip(other: Iterable<R>, transform: (Byte, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -11942,7 +11913,6 @@ public inline fun <R, V> ByteArray.zip(other: Iterable<R>, transform: (Byte, R)
*/
public inline fun <R, V> ShortArray.zip(other: Iterable<R>, transform: (Short, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -11957,7 +11927,6 @@ public inline fun <R, V> ShortArray.zip(other: Iterable<R>, transform: (Short, R
*/
public inline fun <R, V> IntArray.zip(other: Iterable<R>, transform: (Int, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -11972,7 +11941,6 @@ public inline fun <R, V> IntArray.zip(other: Iterable<R>, transform: (Int, R) ->
*/
public inline fun <R, V> LongArray.zip(other: Iterable<R>, transform: (Long, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -11987,7 +11955,6 @@ public inline fun <R, V> LongArray.zip(other: Iterable<R>, transform: (Long, R)
*/
public inline fun <R, V> FloatArray.zip(other: Iterable<R>, transform: (Float, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -12002,7 +11969,6 @@ public inline fun <R, V> FloatArray.zip(other: Iterable<R>, transform: (Float, R
*/
public inline fun <R, V> DoubleArray.zip(other: Iterable<R>, transform: (Double, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -12017,7 +11983,6 @@ public inline fun <R, V> DoubleArray.zip(other: Iterable<R>, transform: (Double,
*/
public inline fun <R, V> BooleanArray.zip(other: Iterable<R>, transform: (Boolean, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -12032,7 +11997,6 @@ public inline fun <R, V> BooleanArray.zip(other: Iterable<R>, transform: (Boolea
*/
public inline fun <R, V> CharArray.zip(other: Iterable<R>, transform: (Char, R) -> V): List<V> {
val arraySize = size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(other.collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in other) {
@@ -961,7 +961,6 @@ public fun Collection<Short>.toShortArray(): ShortArray {
* The returned map preserves the entry iteration order of the original collection.
*/
public inline fun <T, K, V> Iterable<T>.associate(transform: (T) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -975,7 +974,6 @@ public inline fun <T, K, V> Iterable<T>.associate(transform: (T) -> Pair<K, V>):
* The returned map preserves the entry iteration order of the original collection.
*/
public inline fun <T, K> Iterable<T>.associateBy(keySelector: (T) -> K): Map<K, T> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, T>(capacity), keySelector)
}
@@ -988,7 +986,6 @@ public inline fun <T, K> Iterable<T>.associateBy(keySelector: (T) -> K): Map<K,
* The returned map preserves the entry iteration order of the original collection.
*/
public inline fun <T, K, V> Iterable<T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -1885,7 +1882,6 @@ public infix fun <T, R> Iterable<T>.zip(other: Array<out R>): List<Pair<T, R>> {
*/
public inline fun <T, R, V> Iterable<T>.zip(other: Array<out R>, transform: (T, R) -> V): List<V> {
val arraySize = other.size
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(collectionSizeOrDefault(10), arraySize))
var i = 0
for (element in this) {
@@ -1908,7 +1904,6 @@ public infix fun <T, R> Iterable<T>.zip(other: Iterable<R>): List<Pair<T, R>> {
public inline fun <T, R, V> Iterable<T>.zip(other: Iterable<R>, transform: (T, R) -> V): List<V> {
val first = iterator()
val second = other.iterator()
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val list = ArrayList<V>(Math.min(collectionSizeOrDefault(10), other.collectionSizeOrDefault(10)))
while (first.hasNext() && second.hasNext()) {
list.add(transform(first.next(), second.next()))
@@ -505,7 +505,6 @@ public inline fun String.reversed(): String {
* The returned map preserves the entry iteration order of the original char sequence.
*/
public inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair<K, V>): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(length).coerceAtLeast(16)
return associateTo(LinkedHashMap<K, V>(capacity), transform)
}
@@ -519,7 +518,6 @@ public inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair<K, V>)
* The returned map preserves the entry iteration order of the original char sequence.
*/
public inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K): Map<K, Char> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(length).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, Char>(capacity), keySelector)
}
@@ -532,7 +530,6 @@ public inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K): Map<K,
* The returned map preserves the entry iteration order of the original char sequence.
*/
public inline fun <K, V> CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V> {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val capacity = mapCapacity(length).coerceAtLeast(16)
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
}
@@ -38,13 +38,13 @@ internal class IndexingIterable<out T>(private val iteratorFactory: () -> Iterat
/**
* Returns the size of this iterable if it is known, or `null` otherwise.
*/
@kotlin.internal.InlineExposed
@PublishedApi
internal fun <T> Iterable<T>.collectionSizeOrNull(): Int? = if (this is Collection<*>) this.size else null
/**
* Returns the size of this iterable if it is known, or the specified [default] value otherwise.
*/
@kotlin.internal.InlineExposed
@PublishedApi
internal fun <T> Iterable<T>.collectionSizeOrDefault(default: Int): Int = if (this is Collection<*>) this.size else default
/** Returns true when it's safe to convert this collection to a set without changing contains method behavior. */
@@ -11,7 +11,7 @@ package kotlin.collections
* @throws NoSuchElementException when the map doesn't contain a value for the specified key and no implicit default was provided for that map.
*/
@kotlin.jvm.JvmName("getOrImplicitDefaultNullable")
@kotlin.internal.InlineExposed
@PublishedApi
internal fun <K, V> Map<K, V>.getOrImplicitDefault(key: K): V {
if (this is MapWithDefault)
return this.getOrImplicitDefault(key)
@@ -93,7 +93,7 @@ public fun <K, V> linkedMapOf(vararg pairs: Pair<K, V>): LinkedHashMap<K, V>
* to the Collection constructor for HashSet, (c.size()/.75f) + 1, but provides further optimisations for very small or
* very large sizes, allows support non-collection classes, and provides consistency for all map based class construction.
*/
@kotlin.internal.InlineExposed
@PublishedApi
internal fun mapCapacity(expectedSize: Int): Int {
if (expectedSize < 3) {
return expectedSize + 1
@@ -562,7 +562,7 @@ public inline operator fun <K, V> MutableMap<in K, in V>.plusAssign(map: Map<K,
}
// do not expose for now @kotlin.internal.InlineExposed
// do not expose for now @PublishedApi
internal fun <K, V> Map<K, V>.optimizeReadOnlyMap() = when (size) {
0 -> emptyMap()
1 -> toSingletonMapOrSelf()
@@ -74,7 +74,7 @@ public inline fun Timer.scheduleAtFixedRate(time: Date, period: Long, crossinlin
// exposed as public
@kotlin.internal.InlineExposed
@PublishedApi
internal fun timer(name: String?, daemon: Boolean) = if (name == null) Timer(daemon) else Timer(name, daemon)
/**
@@ -87,7 +87,6 @@ internal fun timer(name: String?, daemon: Boolean) = if (name == null) Timer(dae
*/
@kotlin.internal.InlineOnly
public inline fun timer(name: String? = null, daemon: Boolean = false, initialDelay: Long = 0.toLong(), period: Long, crossinline action: TimerTask.() -> Unit): Timer {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val timer = timer(name, daemon)
timer.schedule(initialDelay, period, action)
return timer
@@ -102,7 +101,6 @@ public inline fun timer(name: String? = null, daemon: Boolean = false, initialDe
*/
@kotlin.internal.InlineOnly
public inline fun timer(name: String? = null, daemon: Boolean = false, startAt: Date, period: Long, crossinline action: TimerTask.() -> Unit): Timer {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val timer = timer(name, daemon)
timer.schedule(startAt, period, action)
return timer
@@ -118,7 +116,6 @@ public inline fun timer(name: String? = null, daemon: Boolean = false, startAt:
*/
@kotlin.internal.InlineOnly
public inline fun fixedRateTimer(name: String? = null, daemon: Boolean = false, initialDelay: Long = 0.toLong(), period: Long, crossinline action: TimerTask.() -> Unit): Timer {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val timer = timer(name, daemon)
timer.scheduleAtFixedRate(initialDelay, period, action)
return timer
@@ -133,7 +130,6 @@ public inline fun fixedRateTimer(name: String? = null, daemon: Boolean = false,
*/
@kotlin.internal.InlineOnly
public inline fun fixedRateTimer(name: String? = null, daemon: Boolean = false, startAt: Date, period: Long, crossinline action: TimerTask.() -> Unit): Timer {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
val timer = timer(name, daemon)
timer.scheduleAtFixedRate(startAt, period, action)
return timer
@@ -57,11 +57,4 @@ internal annotation class OnlyInputTypes
*/
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.BINARY)
internal annotation class InlineOnly
/**
* Specifies that this part of internal API is effectively public exposed by using in public inline function
*/
@Target(AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.BINARY)
internal annotation class InlineExposed
internal annotation class InlineOnly
@@ -23,7 +23,7 @@ internal open class PlatformImplementations {
}
@SinceKotlin("1.1")
@kotlin.internal.InlineExposed
@PublishedApi
internal fun platformCloseSuppressed(instance: Closeable, cause: Throwable) = IMPLEMENTATIONS.closeSuppressed(instance, cause)
@@ -157,7 +157,6 @@ public inline fun <T : Closeable?, R> T.use(block: (T) -> R): R {
return block(this)
} catch (e: Throwable) {
closed = true
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
if (this != null) platformCloseSuppressed(this, e)
throw e
} finally {
@@ -94,7 +94,7 @@ public data class MatchGroup(public val value: String, public val range: IntRang
* For pattern syntax reference see [Pattern]
*/
public class Regex
@kotlin.internal.InlineExposed
@PublishedApi
internal constructor(private val nativePattern: Pattern) {
@@ -3,9 +3,9 @@
@file:kotlin.jvm.JvmName("PreconditionsKt")
package kotlin
@kotlin.internal.InlineExposed
@PublishedApi
internal object _Assertions {
@JvmField
@JvmField @PublishedApi
internal val ENABLED: Boolean = javaClass.desiredAssertionStatus()
}
@@ -24,7 +24,6 @@ public inline fun assert(value: Boolean) {
*/
@kotlin.internal.InlineOnly
public inline fun assert(value: Boolean, lazyMessage: () -> Any) {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
if (_Assertions.ENABLED) {
if (!value) {
val message = lazyMessage()