Remove JvmVersion annotation and its usages

This commit is contained in:
Ilya Gorbunov
2018-04-13 22:15:19 +03:00
parent 1eca402332
commit 2c74b91de4
95 changed files with 2 additions and 229 deletions
@@ -1,22 +0,0 @@
/*
* Copyright 2010-2017 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:JvmVersion
package kotlin.jvm
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
internal annotation class JvmVersion(public val minimum: Int = 6, public val maximum: Int = 100)
@@ -1,22 +0,0 @@
/*
* Copyright 2010-2017 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:JvmVersion
package kotlin.jvm
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
internal annotation class JvmVersion(public val minimum: Int = 6, public val maximum: Int = 100)
@@ -22,15 +22,14 @@ sourceSets {
"test" {} "test" {}
} }
val copySources by task<Copy> { val copySources by task<Sync> {
val stdlibProjectDir = project(":kotlin-stdlib").projectDir val stdlibProjectDir = project(":kotlin-stdlib").projectDir
from(stdlibProjectDir.resolve("runtime")) from(stdlibProjectDir.resolve("runtime"))
.include("kotlin/TypeAliases.kt", .include("kotlin/TypeAliases.kt",
"kotlin/text/TypeAliases.kt") "kotlin/text/TypeAliases.kt")
from(stdlibProjectDir.resolve("src")) from(stdlibProjectDir.resolve("src"))
.include("kotlin/collections/TypeAliases.kt", .include("kotlin/collections/TypeAliases.kt")
"kotlin/jvm/JvmVersion.kt")
from(stdlibProjectDir.resolve("../src")) from(stdlibProjectDir.resolve("../src"))
.include("kotlin/util/Standard.kt", .include("kotlin/util/Standard.kt",
"kotlin/internal/Annotations.kt", "kotlin/internal/Annotations.kt",
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("ArraysKt") @file:kotlin.jvm.JvmName("ArraysKt")
@file:kotlin.jvm.JvmVersion
package kotlin.collections package kotlin.collections
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("CollectionsKt") @file:kotlin.jvm.JvmName("CollectionsKt")
@file:kotlin.jvm.JvmVersion
package kotlin.collections package kotlin.collections
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("ComparisonsKt") @file:kotlin.jvm.JvmName("ComparisonsKt")
@file:kotlin.jvm.JvmVersion
package kotlin.comparisons package kotlin.comparisons
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("SequencesKt") @file:kotlin.jvm.JvmName("SequencesKt")
@file:kotlin.jvm.JvmVersion
package kotlin.sequences package kotlin.sequences
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("StringsKt") @file:kotlin.jvm.JvmName("StringsKt")
@file:kotlin.jvm.JvmVersion
package kotlin.text package kotlin.text
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package kotlin.collections package kotlin.collections
import java.util.AbstractCollection import java.util.AbstractCollection
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package kotlin.collections package kotlin.collections
import java.util.AbstractList import java.util.AbstractList
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package kotlin.collections package kotlin.collections
import java.util.AbstractMap import java.util.AbstractMap
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package kotlin.collections package kotlin.collections
import java.util.AbstractSet import java.util.AbstractSet
@@ -5,7 +5,6 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("ArraysKt") @file:kotlin.jvm.JvmName("ArraysKt")
@file:kotlin.jvm.JvmVersion
package kotlin.collections package kotlin.collections
@@ -15,7 +15,6 @@ import kotlin.*
* The returned list is serializable. * The returned list is serializable.
* @sample samples.collections.Collections.Lists.singletonReadOnlyList * @sample samples.collections.Collections.Lists.singletonReadOnlyList
*/ */
@JvmVersion
public fun <T> listOf(element: T): List<T> = java.util.Collections.singletonList(element) public fun <T> listOf(element: T): List<T> = java.util.Collections.singletonList(element)
@@ -24,23 +23,19 @@ public fun <T> listOf(element: T): List<T> = java.util.Collections.singletonList
* in the order they are returned by the enumeration. * in the order they are returned by the enumeration.
* @sample samples.collections.Collections.Lists.listFromEnumeration * @sample samples.collections.Collections.Lists.listFromEnumeration
*/ */
@JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun <T> java.util.Enumeration<T>.toList(): List<T> = java.util.Collections.list(this) public inline fun <T> java.util.Enumeration<T>.toList(): List<T> = java.util.Collections.list(this)
@JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
internal actual inline fun copyToArrayImpl(collection: Collection<*>): Array<Any?> = internal actual inline fun copyToArrayImpl(collection: Collection<*>): Array<Any?> =
kotlin.jvm.internal.collectionToArray(collection) kotlin.jvm.internal.collectionToArray(collection)
@JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
internal actual inline fun <T> copyToArrayImpl(collection: Collection<*>, array: Array<T>): Array<T> = internal actual inline fun <T> copyToArrayImpl(collection: Collection<*>, array: Array<T>): Array<T> =
kotlin.jvm.internal.collectionToArray(collection, array as Array<Any?>) as Array<T> kotlin.jvm.internal.collectionToArray(collection, array as Array<Any?>) as Array<T>
// copies typed varargs array to array of objects // copies typed varargs array to array of objects
@JvmVersion
internal actual fun <T> Array<out T>.copyToArrayOfAny(isVarargs: Boolean): Array<out Any?> = internal actual fun <T> Array<out T>.copyToArrayOfAny(isVarargs: Boolean): Array<out Any?> =
if (isVarargs && this.javaClass == Array<Any?>::class.java) if (isVarargs && this.javaClass == Array<Any?>::class.java)
// if the array came from varargs and already is array of Any, copying isn't required // if the array came from varargs and already is array of Any, copying isn't required
@@ -17,7 +17,6 @@ package kotlin.collections
* @sample samples.collections.Collections.Transformations.groupingByEachCount * @sample samples.collections.Collections.Transformations.groupingByEachCount
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@JvmVersion
public actual fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int> = public actual fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int> =
// fold(0) { acc, e -> acc + 1 } optimized for boxing // fold(0) { acc, e -> acc + 1 } optimized for boxing
foldTo(destination = mutableMapOf(), foldTo(destination = mutableMapOf(),
@@ -32,7 +31,6 @@ public actual fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int> =
* @return a [Map] associating the key of each group with the sum of elements in the group. * @return a [Map] associating the key of each group with the sum of elements in the group.
*/ */
@SinceKotlin("1.X") @SinceKotlin("1.X")
@JvmVersion
public inline fun <T, K> Grouping<T, K>.eachSumOf(valueSelector: (T) -> Int): Map<K, Int> = public inline fun <T, K> Grouping<T, K>.eachSumOf(valueSelector: (T) -> Int): Map<K, Int> =
// fold(0) { acc, e -> acc + valueSelector(e)} optimized for boxing // fold(0) { acc, e -> acc + valueSelector(e)} optimized for boxing
foldTo( destination = mutableMapOf(), foldTo( destination = mutableMapOf(),
@@ -43,7 +41,6 @@ public inline fun <T, K> Grouping<T, K>.eachSumOf(valueSelector: (T) -> Int): Ma
@JvmVersion
@PublishedApi @PublishedApi
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@Suppress("UNCHECKED_CAST") // tricks with erased generics go here, do not repeat on reified platforms @Suppress("UNCHECKED_CAST") // tricks with erased generics go here, do not repeat on reified platforms
@@ -12,7 +12,6 @@ package kotlin.collections
* Creates an [Iterator] for an [java.util.Enumeration], allowing to use it in `for` loops. * Creates an [Iterator] for an [java.util.Enumeration], allowing to use it in `for` loops.
* @sample samples.collections.Iterators.iteratorForEnumeration * @sample samples.collections.Iterators.iteratorForEnumeration
*/ */
@kotlin.jvm.JvmVersion
public operator fun <T> java.util.Enumeration<T>.iterator(): Iterator<T> = object : Iterator<T> { public operator fun <T> java.util.Enumeration<T>.iterator(): Iterator<T> = object : Iterator<T> {
override fun hasNext(): Boolean = hasMoreElements() override fun hasNext(): Boolean = hasMoreElements()
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("MapsKt") @file:kotlin.jvm.JvmName("MapsKt")
@file:kotlin.jvm.JvmVersion
package kotlin.collections package kotlin.collections
@@ -20,7 +19,6 @@ import java.util.concurrent.ConcurrentMap
* *
* @sample samples.collections.Maps.Instantiation.mapFromPairs * @sample samples.collections.Maps.Instantiation.mapFromPairs
*/ */
@JvmVersion
public fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V> = java.util.Collections.singletonMap(pair.first, pair.second) public fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V> = java.util.Collections.singletonMap(pair.first, pair.second)
@@ -78,12 +76,10 @@ public inline fun Map<String, String>.toProperties(): Properties
// creates a singleton copy of map, if there is specialization available in target platform, otherwise returns itself // creates a singleton copy of map, if there is specialization available in target platform, otherwise returns itself
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
internal actual inline fun <K, V> Map<K, V>.toSingletonMapOrSelf(): Map<K, V> = toSingletonMap() internal actual inline fun <K, V> Map<K, V>.toSingletonMapOrSelf(): Map<K, V> = toSingletonMap()
// creates a singleton copy of map // creates a singleton copy of map
@kotlin.jvm.JvmVersion
internal actual fun <K, V> Map<out K, V>.toSingletonMap(): Map<K, V> internal actual fun <K, V> Map<out K, V>.toSingletonMap(): Map<K, V>
= with (entries.iterator().next()) { java.util.Collections.singletonMap(key, value) } = with (entries.iterator().next()) { java.util.Collections.singletonMap(key, value) }
@@ -10,13 +10,11 @@ package kotlin.collections
@Deprecated("Use sortWith(comparator) instead.", ReplaceWith("this.sortWith(comparator)"), level = DeprecationLevel.ERROR) @Deprecated("Use sortWith(comparator) instead.", ReplaceWith("this.sortWith(comparator)"), level = DeprecationLevel.ERROR)
@JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@Suppress("UNUSED_PARAMETER") @Suppress("UNUSED_PARAMETER")
public inline fun <T> MutableList<T>.sort(comparator: Comparator<in T>): Unit = throw NotImplementedError() public inline fun <T> MutableList<T>.sort(comparator: Comparator<in T>): Unit = throw NotImplementedError()
@Deprecated("Use sortWith(Comparator(comparison)) instead.", ReplaceWith("this.sortWith(Comparator(comparison))"), level = DeprecationLevel.ERROR) @Deprecated("Use sortWith(Comparator(comparison)) instead.", ReplaceWith("this.sortWith(Comparator(comparison))"), level = DeprecationLevel.ERROR)
@JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@Suppress("UNUSED_PARAMETER") @Suppress("UNUSED_PARAMETER")
public inline fun <T> MutableList<T>.sort(comparison: (T, T) -> Int): Unit = throw NotImplementedError() public inline fun <T> MutableList<T>.sort(comparison: (T, T) -> Int): Unit = throw NotImplementedError()
@@ -25,7 +23,6 @@ public inline fun <T> MutableList<T>.sort(comparison: (T, T) -> Int): Unit = thr
/** /**
* Sorts elements in the list in-place according to their natural sort order. * Sorts elements in the list in-place according to their natural sort order.
*/ */
@kotlin.jvm.JvmVersion
public actual fun <T : Comparable<T>> MutableList<T>.sort(): Unit { public actual fun <T : Comparable<T>> MutableList<T>.sort(): Unit {
if (size > 1) java.util.Collections.sort(this) if (size > 1) java.util.Collections.sort(this)
} }
@@ -33,7 +30,6 @@ public actual fun <T : Comparable<T>> MutableList<T>.sort(): Unit {
/** /**
* Sorts elements in the list in-place according to the order specified with [comparator]. * Sorts elements in the list in-place according to the order specified with [comparator].
*/ */
@kotlin.jvm.JvmVersion
public actual fun <T> MutableList<T>.sortWith(comparator: Comparator<in T>): Unit { public actual fun <T> MutableList<T>.sortWith(comparator: Comparator<in T>): Unit {
if (size > 1) java.util.Collections.sort(this, comparator) if (size > 1) java.util.Collections.sort(this, comparator)
} }
@@ -43,7 +39,6 @@ public actual fun <T> MutableList<T>.sortWith(comparator: Comparator<in T>): Uni
* *
* Each element in the list gets replaced with the [value]. * Each element in the list gets replaced with the [value].
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@SinceKotlin("1.2") @SinceKotlin("1.2")
public actual inline fun <T> MutableList<T>.fill(value: T) { public actual inline fun <T> MutableList<T>.fill(value: T) {
@@ -54,7 +49,6 @@ public actual inline fun <T> MutableList<T>.fill(value: T) {
/** /**
* Randomly shuffles elements in this mutable list. * Randomly shuffles elements in this mutable list.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@SinceKotlin("1.2") @SinceKotlin("1.2")
public actual inline fun <T> MutableList<T>.shuffle() { public actual inline fun <T> MutableList<T>.shuffle() {
@@ -64,7 +58,6 @@ public actual inline fun <T> MutableList<T>.shuffle() {
/** /**
* Randomly shuffles elements in this mutable list using the specified [random] instance as the source of randomness. * Randomly shuffles elements in this mutable list using the specified [random] instance as the source of randomness.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@SinceKotlin("1.2") @SinceKotlin("1.2")
public inline fun <T> MutableList<T>.shuffle(random: java.util.Random) { public inline fun <T> MutableList<T>.shuffle(random: java.util.Random) {
@@ -74,7 +67,6 @@ public inline fun <T> MutableList<T>.shuffle(random: java.util.Random) {
/** /**
* Returns a new list with the elements of this list randomly shuffled. * Returns a new list with the elements of this list randomly shuffled.
*/ */
@kotlin.jvm.JvmVersion
@SinceKotlin("1.2") @SinceKotlin("1.2")
public actual fun <T> Iterable<T>.shuffled(): List<T> = toMutableList().apply { shuffle() } public actual fun <T> Iterable<T>.shuffled(): List<T> = toMutableList().apply { shuffle() }
@@ -82,6 +74,5 @@ public actual fun <T> Iterable<T>.shuffled(): List<T> = toMutableList().apply {
* Returns a new list with the elements of this list randomly shuffled * Returns a new list with the elements of this list randomly shuffled
* using the specified [random] instance as the source of randomness. * using the specified [random] instance as the source of randomness.
*/ */
@kotlin.jvm.JvmVersion
@SinceKotlin("1.2") @SinceKotlin("1.2")
public fun <T> Iterable<T>.shuffled(random: java.util.Random): List<T> = toMutableList().apply { shuffle(random) } public fun <T> Iterable<T>.shuffled(random: java.util.Random): List<T> = toMutableList().apply { shuffle(random) }
@@ -14,12 +14,10 @@ import kotlin.*
* Creates a sequence that returns all values from this enumeration. The sequence is constrained to be iterated only once. * Creates a sequence that returns all values from this enumeration. The sequence is constrained to be iterated only once.
* @sample samples.collections.Sequences.Building.sequenceFromEnumeration * @sample samples.collections.Sequences.Building.sequenceFromEnumeration
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun<T> java.util.Enumeration<T>.asSequence(): Sequence<T> = this.iterator().asSequence() public inline fun<T> java.util.Enumeration<T>.asSequence(): Sequence<T> = this.iterator().asSequence()
@kotlin.jvm.JvmVersion
internal actual class ConstrainedOnceSequence<T> actual constructor(sequence: Sequence<T>) : Sequence<T> { internal actual class ConstrainedOnceSequence<T> actual constructor(sequence: Sequence<T>) : Sequence<T> {
private val sequenceRef = java.util.concurrent.atomic.AtomicReference(sequence) private val sequenceRef = java.util.concurrent.atomic.AtomicReference(sequence)
@@ -13,19 +13,16 @@ package kotlin.collections
* Returns an immutable set containing only the specified object [element]. * Returns an immutable set containing only the specified object [element].
* The returned set is serializable. * The returned set is serializable.
*/ */
@JvmVersion
public fun <T> setOf(element: T): Set<T> = java.util.Collections.singleton(element) public fun <T> setOf(element: T): Set<T> = java.util.Collections.singleton(element)
/** /**
* Returns a new [java.util.SortedSet] with the given elements. * Returns a new [java.util.SortedSet] with the given elements.
*/ */
@JvmVersion
public fun <T> sortedSetOf(vararg elements: T): java.util.TreeSet<T> = elements.toCollection(java.util.TreeSet<T>()) public fun <T> sortedSetOf(vararg elements: T): java.util.TreeSet<T> = elements.toCollection(java.util.TreeSet<T>())
/** /**
* Returns a new [java.util.SortedSet] with the given [comparator] and elements. * Returns a new [java.util.SortedSet] with the given [comparator] and elements.
*/ */
@JvmVersion
public fun <T> sortedSetOf(comparator: Comparator<in T>, vararg elements: T): java.util.TreeSet<T> = elements.toCollection(java.util.TreeSet<T>(comparator)) public fun <T> sortedSetOf(comparator: Comparator<in T>, vararg elements: T): java.util.TreeSet<T> = elements.toCollection(java.util.TreeSet<T>(comparator))
@@ -1,5 +1,3 @@
@file:kotlin.jvm.JvmVersion
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-stdlib-minimal-for-test @file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-stdlib-minimal-for-test
package kotlin.collections package kotlin.collections
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
@file:JvmName("LocksKt") @file:JvmName("LocksKt")
package kotlin.concurrent package kotlin.concurrent
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmName("ThreadsKt") @file:JvmName("ThreadsKt")
package kotlin.concurrent package kotlin.concurrent
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmName("TimersKt") @file:JvmName("TimersKt")
package kotlin.concurrent package kotlin.concurrent
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@file:kotlin.jvm.JvmVersion
package kotlin.coroutines.experimental package kotlin.coroutines.experimental
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater import java.util.concurrent.atomic.AtomicReferenceFieldUpdater
@@ -16,7 +16,6 @@
@file:kotlin.jvm.JvmName("IntrinsicsKt") @file:kotlin.jvm.JvmName("IntrinsicsKt")
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmVersion
package kotlin.coroutines.experimental.intrinsics package kotlin.coroutines.experimental.intrinsics
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -63,7 +62,6 @@ public actual inline fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedO
* state machine of the coroutine and may result in arbitrary behaviour or exception. * state machine of the coroutine and may result in arbitrary behaviour or exception.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
public actual fun <T> (suspend () -> T).createCoroutineUnchecked( public actual fun <T> (suspend () -> T).createCoroutineUnchecked(
completion: Continuation<T> completion: Continuation<T>
): Continuation<Unit> = ): Continuation<Unit> =
@@ -86,7 +84,6 @@ public actual fun <T> (suspend () -> T).createCoroutineUnchecked(
* state machine of the coroutine and may result in arbitrary behaviour or exception. * state machine of the coroutine and may result in arbitrary behaviour or exception.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
public actual fun <R, T> (suspend R.() -> T).createCoroutineUnchecked( public actual fun <R, T> (suspend R.() -> T).createCoroutineUnchecked(
receiver: R, receiver: R,
completion: Continuation<T> completion: Continuation<T>
@@ -101,7 +98,6 @@ public actual fun <R, T> (suspend R.() -> T).createCoroutineUnchecked(
// INTERNAL DEFINITIONS // INTERNAL DEFINITIONS
@kotlin.jvm.JvmVersion
private inline fun <T> buildContinuationByInvokeCall( private inline fun <T> buildContinuationByInvokeCall(
completion: Continuation<T>, completion: Continuation<T>,
crossinline block: () -> Any? crossinline block: () -> Any?
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
package kotlin.coroutines.experimental.jvm.internal package kotlin.coroutines.experimental.jvm.internal
import java.lang.IllegalStateException import java.lang.IllegalStateException
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
@file:JvmName("CoroutineIntrinsics") @file:JvmName("CoroutineIntrinsics")
package kotlin.coroutines.experimental.jvm.internal package kotlin.coroutines.experimental.jvm.internal
@@ -1,4 +1,3 @@
@file:JvmVersion
package kotlin.internal package kotlin.internal
import kotlin.* import kotlin.*
@@ -15,7 +15,6 @@
*/ */
@file:JvmName("CloseableKt") @file:JvmName("CloseableKt")
@file:JvmVersion
package kotlin.io package kotlin.io
import java.io.Closeable import java.io.Closeable
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmName("ConsoleKt") @file:JvmName("ConsoleKt")
package kotlin.io package kotlin.io
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmName("ConstantsKt") @file:JvmName("ConstantsKt")
package kotlin.io package kotlin.io
@@ -1,4 +1,3 @@
@file:JvmVersion
package kotlin.io package kotlin.io
import kotlin.text.* import kotlin.text.*
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmMultifileClass @file:JvmMultifileClass
@file:JvmName("FilesKt") @file:JvmName("FilesKt")
package kotlin.io package kotlin.io
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmName("ByteStreamsKt") @file:JvmName("ByteStreamsKt")
package kotlin.io package kotlin.io
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmName("TextStreamsKt") @file:JvmName("TextStreamsKt")
package kotlin.io package kotlin.io
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
package kotlin.io package kotlin.io
// to use in shared code without imports // to use in shared code without imports
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmMultifileClass @file:JvmMultifileClass
@file:JvmName("FilesKt") @file:JvmName("FilesKt")
package kotlin.io package kotlin.io
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmMultifileClass @file:JvmMultifileClass
@file:JvmName("FilesKt") @file:JvmName("FilesKt")
package kotlin.io package kotlin.io
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:JvmMultifileClass @file:JvmMultifileClass
@file:JvmName("FilesKt") @file:JvmName("FilesKt")
package kotlin.io package kotlin.io
@@ -2,7 +2,6 @@
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package kotlin.jvm package kotlin.jvm
@@ -1,21 +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:JvmVersion
package kotlin.jvm
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
internal annotation class JvmVersion(public val minimum: Int = 6, public val maximum: Int = 100)
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
package kotlin.jvm.internal.unsafe package kotlin.jvm.internal.unsafe
import kotlin.* import kotlin.*
@@ -14,7 +14,6 @@ import kotlin.*
* *
* Numbers are compared with the ends of this range according to IEEE-754. * Numbers are compared with the ends of this range according to IEEE-754.
*/ */
@JvmVersion
private class ClosedFloatRange ( private class ClosedFloatRange (
start: Float, start: Float,
endInclusive: Float endInclusive: Float
@@ -46,7 +45,6 @@ private class ClosedFloatRange (
* Numbers are compared with the ends of this range according to IEEE-754. * Numbers are compared with the ends of this range according to IEEE-754.
* @sample samples.ranges.Ranges.rangeFromFloat * @sample samples.ranges.Ranges.rangeFromFloat
*/ */
@JvmVersion
@SinceKotlin("1.1") @SinceKotlin("1.1")
public operator fun Float.rangeTo(that: Float): ClosedFloatingPointRange<Float> = ClosedFloatRange(this, that) public operator fun Float.rangeTo(that: Float): ClosedFloatingPointRange<Float> = ClosedFloatRange(this, that)
@@ -1,5 +1,4 @@
@file:kotlin.jvm.JvmName("ProcessKt") @file:kotlin.jvm.JvmName("ProcessKt")
@file:kotlin.jvm.JvmVersion
package kotlin.system package kotlin.system
import kotlin.* import kotlin.*
@@ -1,5 +1,4 @@
@file:kotlin.jvm.JvmName("TimingKt") @file:kotlin.jvm.JvmName("TimingKt")
@file:kotlin.jvm.JvmVersion
package kotlin.system package kotlin.system
/** /**
@@ -1,4 +1,3 @@
@file:JvmVersion
package kotlin.text package kotlin.text
import kotlin.* import kotlin.*
@@ -1,4 +1,3 @@
@file:JvmVersion
package kotlin.text package kotlin.text
import kotlin.* import kotlin.*
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@file:kotlin.jvm.JvmVersion
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("CharsKt") @file:kotlin.jvm.JvmName("CharsKt")
@@ -1,5 +1,4 @@
@file:JvmName("CharsetsKt") @file:JvmName("CharsetsKt")
@file:JvmVersion
package kotlin.text package kotlin.text
import java.nio.charset.* import java.nio.charset.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("StringsKt") @file:kotlin.jvm.JvmName("StringsKt")
@@ -7,7 +6,6 @@ package kotlin.text
/** /**
* Sets the character at the specified [index] to the specified [value]. * Sets the character at the specified [index] to the specified [value].
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline operator fun StringBuilder.set(index: Int, value: Char): Unit = this.setCharAt(index, value) public inline operator fun StringBuilder.set(index: Int, value: Char): Unit = this.setCharAt(index, value)
@@ -18,7 +18,6 @@ import kotlin.*
* @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun Byte.toString(radix: Int): String = this.toInt().toString(checkRadix(radix)) public inline fun Byte.toString(radix: Int): String = this.toInt().toString(checkRadix(radix))
@@ -28,7 +27,6 @@ public inline fun Byte.toString(radix: Int): String = this.toInt().toString(chec
* @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun Short.toString(radix: Int): String = this.toInt().toString(checkRadix(radix)) public inline fun Short.toString(radix: Int): String = this.toInt().toString(checkRadix(radix))
@@ -38,7 +36,6 @@ public inline fun Short.toString(radix: Int): String = this.toInt().toString(che
* @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun Int.toString(radix: Int): String = java.lang.Integer.toString(this, checkRadix(radix)) public inline fun Int.toString(radix: Int): String = java.lang.Integer.toString(this, checkRadix(radix))
@@ -48,14 +45,12 @@ public inline fun Int.toString(radix: Int): String = java.lang.Integer.toString(
* @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun Long.toString(radix: Int): String = java.lang.Long.toString(this, checkRadix(radix)) public inline fun Long.toString(radix: Int): String = java.lang.Long.toString(this, checkRadix(radix))
/** /**
* Returns `true` if the contents of this string is equal to the word "true", ignoring case, and `false` otherwise. * Returns `true` if the contents of this string is equal to the word "true", ignoring case, and `false` otherwise.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toBoolean(): Boolean = java.lang.Boolean.parseBoolean(this) public actual inline fun String.toBoolean(): Boolean = java.lang.Boolean.parseBoolean(this)
@@ -63,7 +58,6 @@ public actual inline fun String.toBoolean(): Boolean = java.lang.Boolean.parseBo
* Parses the string as a signed [Byte] number and returns the result. * Parses the string as a signed [Byte] number and returns the result.
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toByte(): Byte = java.lang.Byte.parseByte(this) public actual inline fun String.toByte(): Byte = java.lang.Byte.parseByte(this)
@@ -73,7 +67,6 @@ public actual inline fun String.toByte(): Byte = java.lang.Byte.parseByte(this)
* @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toByte(radix: Int): Byte = java.lang.Byte.parseByte(this, checkRadix(radix)) public actual inline fun String.toByte(radix: Int): Byte = java.lang.Byte.parseByte(this, checkRadix(radix))
@@ -82,7 +75,6 @@ public actual inline fun String.toByte(radix: Int): Byte = java.lang.Byte.parseB
* Parses the string as a [Short] number and returns the result. * Parses the string as a [Short] number and returns the result.
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toShort(): Short = java.lang.Short.parseShort(this) public actual inline fun String.toShort(): Short = java.lang.Short.parseShort(this)
@@ -92,7 +84,6 @@ public actual inline fun String.toShort(): Short = java.lang.Short.parseShort(th
* @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toShort(radix: Int): Short = java.lang.Short.parseShort(this, checkRadix(radix)) public actual inline fun String.toShort(radix: Int): Short = java.lang.Short.parseShort(this, checkRadix(radix))
@@ -100,7 +91,6 @@ public actual inline fun String.toShort(radix: Int): Short = java.lang.Short.par
* Parses the string as an [Int] number and returns the result. * Parses the string as an [Int] number and returns the result.
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toInt(): Int = java.lang.Integer.parseInt(this) public actual inline fun String.toInt(): Int = java.lang.Integer.parseInt(this)
@@ -110,7 +100,6 @@ public actual inline fun String.toInt(): Int = java.lang.Integer.parseInt(this)
* @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toInt(radix: Int): Int = java.lang.Integer.parseInt(this, checkRadix(radix)) public actual inline fun String.toInt(radix: Int): Int = java.lang.Integer.parseInt(this, checkRadix(radix))
@@ -118,7 +107,6 @@ public actual inline fun String.toInt(radix: Int): Int = java.lang.Integer.parse
* Parses the string as a [Long] number and returns the result. * Parses the string as a [Long] number and returns the result.
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toLong(): Long = java.lang.Long.parseLong(this) public actual inline fun String.toLong(): Long = java.lang.Long.parseLong(this)
@@ -128,7 +116,6 @@ public actual inline fun String.toLong(): Long = java.lang.Long.parseLong(this)
* @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toLong(radix: Int): Long = java.lang.Long.parseLong(this, checkRadix(radix)) public actual inline fun String.toLong(radix: Int): Long = java.lang.Long.parseLong(this, checkRadix(radix))
@@ -136,7 +123,6 @@ public actual inline fun String.toLong(radix: Int): Long = java.lang.Long.parseL
* Parses the string as a [Float] number and returns the result. * Parses the string as a [Float] number and returns the result.
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toFloat(): Float = java.lang.Float.parseFloat(this) public actual inline fun String.toFloat(): Float = java.lang.Float.parseFloat(this)
@@ -144,7 +130,6 @@ public actual inline fun String.toFloat(): Float = java.lang.Float.parseFloat(th
* Parses the string as a [Double] number and returns the result. * Parses the string as a [Double] number and returns the result.
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public actual inline fun String.toDouble(): Double = java.lang.Double.parseDouble(this) public actual inline fun String.toDouble(): Double = java.lang.Double.parseDouble(this)
@@ -154,7 +139,6 @@ public actual inline fun String.toDouble(): Double = java.lang.Double.parseDoubl
* or `null` if the string is not a valid representation of a number. * or `null` if the string is not a valid representation of a number.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
public actual fun String.toFloatOrNull(): Float? = screenFloatValue(this, java.lang.Float::parseFloat) public actual fun String.toFloatOrNull(): Float? = screenFloatValue(this, java.lang.Float::parseFloat)
/** /**
@@ -162,7 +146,6 @@ public actual fun String.toFloatOrNull(): Float? = screenFloatValue(this, java.l
* or `null` if the string is not a valid representation of a number. * or `null` if the string is not a valid representation of a number.
*/ */
@SinceKotlin("1.1") @SinceKotlin("1.1")
@kotlin.jvm.JvmVersion
public actual fun String.toDoubleOrNull(): Double? = screenFloatValue(this, java.lang.Double::parseDouble) public actual fun String.toDoubleOrNull(): Double? = screenFloatValue(this, java.lang.Double::parseDouble)
/** /**
@@ -170,7 +153,6 @@ public actual fun String.toDoubleOrNull(): Double? = screenFloatValue(this, java
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun String.toBigInteger(): java.math.BigInteger = public inline fun String.toBigInteger(): java.math.BigInteger =
java.math.BigInteger(this) java.math.BigInteger(this)
@@ -181,7 +163,6 @@ public inline fun String.toBigInteger(): java.math.BigInteger =
* @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun String.toBigInteger(radix: Int): java.math.BigInteger = public inline fun String.toBigInteger(radix: Int): java.math.BigInteger =
java.math.BigInteger(this, checkRadix(radix)) java.math.BigInteger(this, checkRadix(radix))
@@ -191,7 +172,6 @@ public inline fun String.toBigInteger(radix: Int): java.math.BigInteger =
* or `null` if the string is not a valid representation of a number. * or `null` if the string is not a valid representation of a number.
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
public fun String.toBigIntegerOrNull(): java.math.BigInteger? = toBigIntegerOrNull(10) public fun String.toBigIntegerOrNull(): java.math.BigInteger? = toBigIntegerOrNull(10)
/** /**
@@ -201,7 +181,6 @@ public fun String.toBigIntegerOrNull(): java.math.BigInteger? = toBigIntegerOrNu
* @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion. * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
public fun String.toBigIntegerOrNull(radix: Int): java.math.BigInteger? { public fun String.toBigIntegerOrNull(radix: Int): java.math.BigInteger? {
checkRadix(radix) checkRadix(radix)
val length = this.length val length = this.length
@@ -225,7 +204,6 @@ public fun String.toBigIntegerOrNull(radix: Int): java.math.BigInteger? {
* @throws NumberFormatException if the string is not a valid representation of a number. * @throws NumberFormatException if the string is not a valid representation of a number.
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun String.toBigDecimal(): java.math.BigDecimal = public inline fun String.toBigDecimal(): java.math.BigDecimal =
java.math.BigDecimal(this) java.math.BigDecimal(this)
@@ -238,7 +216,6 @@ public inline fun String.toBigDecimal(): java.math.BigDecimal =
* @throws ArithmeticException if the rounding is needed, but the rounding mode is [java.math.RoundingMode.UNNECESSARY]. * @throws ArithmeticException if the rounding is needed, but the rounding mode is [java.math.RoundingMode.UNNECESSARY].
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun String.toBigDecimal(mathContext: java.math.MathContext): java.math.BigDecimal = public inline fun String.toBigDecimal(mathContext: java.math.MathContext): java.math.BigDecimal =
java.math.BigDecimal(this, mathContext) java.math.BigDecimal(this, mathContext)
@@ -248,7 +225,6 @@ public inline fun String.toBigDecimal(mathContext: java.math.MathContext): java.
* or `null` if the string is not a valid representation of a number. * or `null` if the string is not a valid representation of a number.
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
public fun String.toBigDecimalOrNull(): java.math.BigDecimal? = public fun String.toBigDecimalOrNull(): java.math.BigDecimal? =
screenFloatValue(this) { it.toBigDecimal() } screenFloatValue(this) { it.toBigDecimal() }
@@ -260,14 +236,12 @@ public fun String.toBigDecimalOrNull(): java.math.BigDecimal? =
* @throws ArithmeticException if the rounding is needed, but the rounding mode is [java.math.RoundingMode.UNNECESSARY]. * @throws ArithmeticException if the rounding is needed, but the rounding mode is [java.math.RoundingMode.UNNECESSARY].
*/ */
@SinceKotlin("1.2") @SinceKotlin("1.2")
@kotlin.jvm.JvmVersion
public fun String.toBigDecimalOrNull(mathContext: java.math.MathContext): java.math.BigDecimal? = public fun String.toBigDecimalOrNull(mathContext: java.math.MathContext): java.math.BigDecimal? =
screenFloatValue(this) { it.toBigDecimal(mathContext) } screenFloatValue(this) { it.toBigDecimal(mathContext) }
/** /**
* Recommended floating point number validation RegEx from the javadoc of `java.lang.Double.valueOf(String)` * Recommended floating point number validation RegEx from the javadoc of `java.lang.Double.valueOf(String)`
*/ */
@kotlin.jvm.JvmVersion
private object ScreenFloatValueRegEx { private object ScreenFloatValueRegEx {
@JvmField val value = run { @JvmField val value = run {
val Digits = "(\\p{Digit}+)" val Digits = "(\\p{Digit}+)"
@@ -287,7 +261,6 @@ private object ScreenFloatValueRegEx {
} }
} }
@kotlin.jvm.JvmVersion
private inline fun <T> screenFloatValue(str: String, parse: (String) -> T): T? { private inline fun <T> screenFloatValue(str: String, parse: (String) -> T): T? {
return try { return try {
if (ScreenFloatValueRegEx.value.matches(str)) if (ScreenFloatValueRegEx.value.matches(str))
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("StringsKt") @file:kotlin.jvm.JvmName("StringsKt")
@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") @file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
package kotlin.text package kotlin.text
import java.util.Collections import java.util.Collections
@@ -14,6 +14,5 @@ package kotlin.text
* *
* Provides the way to use Regex API on the instances of [java.util.regex.Pattern]. * Provides the way to use Regex API on the instances of [java.util.regex.Pattern].
*/ */
@JvmVersion
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
public inline fun java.util.regex.Pattern.toRegex(): Regex = Regex(this) public inline fun java.util.regex.Pattern.toRegex(): Regex = Regex(this)
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("PreconditionsKt") @file:kotlin.jvm.JvmName("PreconditionsKt")
package kotlin package kotlin
@@ -16,7 +16,6 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("MathKt") @file:kotlin.jvm.JvmName("MathKt")
@file:kotlin.jvm.JvmVersion
package kotlin package kotlin
@@ -16,7 +16,6 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("MathKt") @file:kotlin.jvm.JvmName("MathKt")
@file:kotlin.jvm.JvmVersion
package kotlin package kotlin
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("ExceptionsKt") @file:kotlin.jvm.JvmName("ExceptionsKt")
@file:kotlin.jvm.JvmVersion
@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") @file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
package kotlin package kotlin
@@ -18,7 +18,6 @@ package kotlin
* Note that the returned instance uses itself to synchronize on. Do not synchronize from external code on * Note that the returned instance uses itself to synchronize on. Do not synchronize from external code on
* the returned instance as it may cause accidental deadlock. Also this behavior can be changed in the future. * the returned instance as it may cause accidental deadlock. Also this behavior can be changed in the future.
*/ */
@kotlin.jvm.JvmVersion
public actual fun <T> lazy(initializer: () -> T): Lazy<T> = SynchronizedLazyImpl(initializer) public actual fun <T> lazy(initializer: () -> T): Lazy<T> = SynchronizedLazyImpl(initializer)
/** /**
@@ -31,7 +30,6 @@ public actual fun <T> lazy(initializer: () -> T): Lazy<T> = SynchronizedLazyImpl
* to synchronize on. Do not synchronize from external code on the returned instance as it may cause accidental deadlock. * to synchronize on. Do not synchronize from external code on the returned instance as it may cause accidental deadlock.
* Also this behavior can be changed in the future. * Also this behavior can be changed in the future.
*/ */
@kotlin.jvm.JvmVersion
public actual fun <T> lazy(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy<T> = public actual fun <T> lazy(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy<T> =
when (mode) { when (mode) {
LazyThreadSafetyMode.SYNCHRONIZED -> SynchronizedLazyImpl(initializer) LazyThreadSafetyMode.SYNCHRONIZED -> SynchronizedLazyImpl(initializer)
@@ -50,12 +48,10 @@ public actual fun <T> lazy(mode: LazyThreadSafetyMode, initializer: () -> T): La
* in this case do not synchronize from external code on the returned instance as it may cause accidental deadlock. * in this case do not synchronize from external code on the returned instance as it may cause accidental deadlock.
* Also this behavior can be changed in the future. * Also this behavior can be changed in the future.
*/ */
@kotlin.jvm.JvmVersion
public actual fun <T> lazy(lock: Any?, initializer: () -> T): Lazy<T> = SynchronizedLazyImpl(initializer, lock) public actual fun <T> lazy(lock: Any?, initializer: () -> T): Lazy<T> = SynchronizedLazyImpl(initializer, lock)
@JvmVersion
private class SynchronizedLazyImpl<out T>(initializer: () -> T, lock: Any? = null) : Lazy<T>, Serializable { private class SynchronizedLazyImpl<out T>(initializer: () -> T, lock: Any? = null) : Lazy<T>, Serializable {
private var initializer: (() -> T)? = initializer private var initializer: (() -> T)? = initializer
@Volatile private var _value: Any? = UNINITIALIZED_VALUE @Volatile private var _value: Any? = UNINITIALIZED_VALUE
@@ -92,7 +88,6 @@ private class SynchronizedLazyImpl<out T>(initializer: () -> T, lock: Any? = nul
} }
@kotlin.jvm.JvmVersion
private class SafePublicationLazyImpl<out T>(initializer: () -> T) : Lazy<T>, Serializable { private class SafePublicationLazyImpl<out T>(initializer: () -> T) : Lazy<T>, Serializable {
@Volatile private var initializer: (() -> T)? = initializer @Volatile private var initializer: (() -> T)? = initializer
@Volatile private var _value: Any? = UNINITIALIZED_VALUE @Volatile private var _value: Any? = UNINITIALIZED_VALUE
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
@file:JvmMultifileClass @file:JvmMultifileClass
@file:JvmName("MathKt") @file:JvmName("MathKt")
@@ -1,6 +1,5 @@
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("MathKt") @file:kotlin.jvm.JvmName("MathKt")
@file:kotlin.jvm.JvmVersion
package kotlin package kotlin
/** /**
@@ -1,4 +1,3 @@
@file:JvmVersion
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("StandardKt") @file:kotlin.jvm.JvmName("StandardKt")
package kotlin package kotlin
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.exceptions package test.exceptions
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.collections package test.collections
import test.assertStaticAndRuntimeTypeIs import test.assertStaticAndRuntimeTypeIs
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:kotlin.jvm.JvmVersion
package test.collections package test.collections
import java.util.* import java.util.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.collections package test.collections
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.collections package test.collections
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package test.collections package test.collections
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.collections package test.collections
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.concurrent package test.concurrent
import kotlin.concurrent.* import kotlin.concurrent.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.concurrent package test.concurrent
import java.util.* import java.util.*
-1
View File
@@ -4,7 +4,6 @@
*/ */
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") @file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:kotlin.jvm.JvmVersion
package test.io package test.io
import org.junit.Test import org.junit.Test
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.io package test.io
import java.io.File import java.io.File
-1
View File
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.io package test.io
import java.io.* import java.io.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.io package test.io
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.io package test.io
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.io package test.io
import java.io.* import java.io.*
-1
View File
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:JvmVersion
package test.collections.js package test.collections.js
public actual fun <V> stringMapOf(vararg pairs: Pair<String, V>): HashMap<String, V> = hashMapOf<String, V>(*pairs) public actual fun <V> stringMapOf(vararg pairs: Pair<String, V>): HashMap<String, V> = hashMapOf<String, V>(*pairs)
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.numbers package test.numbers
import java.math.BigInteger import java.math.BigInteger
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:kotlin.jvm.JvmVersion
package test.numbers package test.numbers
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.numbers package test.numbers
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.numbers package test.numbers
import java.math.BigDecimal import java.math.BigDecimal
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package test.properties.delegation.lazy package test.properties.delegation.lazy
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.ranges package test.ranges
import java.lang.Integer.MAX_VALUE as MaxI import java.lang.Integer.MAX_VALUE as MaxI
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
@file:Suppress("DEPRECATION", "DEPRECATED_JAVA_ANNOTATION") @file:Suppress("DEPRECATION", "DEPRECATED_JAVA_ANNOTATION")
package test.reflection package test.reflection
@@ -18,18 +18,14 @@ package test
import kotlin.test.assertEquals import kotlin.test.assertEquals
@JvmVersion
public actual fun assertTypeEquals(expected: Any?, actual: Any?) { public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
assertEquals(expected?.javaClass, actual?.javaClass) assertEquals(expected?.javaClass, actual?.javaClass)
} }
@JvmVersion
public actual fun randomInt(limit: Int): Int = (Math.random() * limit).toInt() public actual fun randomInt(limit: Int): Int = (Math.random() * limit).toInt()
@kotlin.jvm.JvmVersion
private val isJava6 = System.getProperty("java.version").startsWith("1.6.") private val isJava6 = System.getProperty("java.version").startsWith("1.6.")
@kotlin.jvm.JvmVersion
internal actual fun String.removeLeadingPlusOnJava6(): String = internal actual fun String.removeLeadingPlusOnJava6(): String =
if (isJava6) removePrefix("+") else this if (isJava6) removePrefix("+") else this
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.text package test.text
import kotlin.test.* import kotlin.test.*
@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
@file:kotlin.jvm.JvmVersion
package test.text package test.text
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.text package test.text
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.text package test.text
import test.collections.assertArrayNotSameButEquals import test.collections.assertArrayNotSameButEquals
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package test.text package test.text
import test.* import test.*
@@ -11,21 +10,18 @@ import kotlin.test.*
class StringNumberConversionJVMTest { class StringNumberConversionJVMTest {
@JvmVersion
@Test fun toIntArabicDigits() { @Test fun toIntArabicDigits() {
compareConversion({ it.toInt() }, { it.toIntOrNull() }) { compareConversion({ it.toInt() }, { it.toIntOrNull() }) {
assertProduces("٢٣١٩٦٠", 231960) assertProduces("٢٣١٩٦٠", 231960)
} }
} }
@JvmVersion
@Test fun toLongArabicDigits() { @Test fun toLongArabicDigits() {
compareConversion({ it.toLong() }, { it.toLongOrNull() }) { compareConversion({ it.toLong() }, { it.toLongOrNull() }) {
assertProduces("٢٣١٩٦٠٧٧٨٤٥٩", 231960778459) assertProduces("٢٣١٩٦٠٧٧٨٤٥٩", 231960778459)
} }
} }
@kotlin.jvm.JvmVersion
@Test fun toFloat() { @Test fun toFloat() {
compareConversion(String::toFloat, String::toFloatOrNull) { compareConversion(String::toFloat, String::toFloatOrNull) {
assertProduces("77.0", 77.0f) assertProduces("77.0", 77.0f)
@@ -38,7 +34,6 @@ class StringNumberConversionJVMTest {
} }
@kotlin.jvm.JvmVersion
@Test fun toHexDouble() { @Test fun toHexDouble() {
compareConversion(String::toDouble, String::toDoubleOrNull, ::doubleTotalOrderEquals) { compareConversion(String::toDouble, String::toDoubleOrNull, ::doubleTotalOrderEquals) {
assertProduces("0x77p1", (0x77 shl 1).toDouble()) assertProduces("0x77p1", (0x77 shl 1).toDouble())
@@ -49,7 +44,6 @@ class StringNumberConversionJVMTest {
} }
@kotlin.jvm.JvmVersion
@Test fun byteToStringWithRadix() { @Test fun byteToStringWithRadix() {
assertEquals("7a", 0x7a.toByte().toString(16)) assertEquals("7a", 0x7a.toByte().toString(16))
assertEquals("-80", Byte.MIN_VALUE.toString(radix = 16)) assertEquals("-80", Byte.MIN_VALUE.toString(radix = 16))
@@ -60,7 +54,6 @@ class StringNumberConversionJVMTest {
assertFailsWith<IllegalArgumentException>("Expected to fail with radix 1") { 1.toByte().toString(radix = 1) } assertFailsWith<IllegalArgumentException>("Expected to fail with radix 1") { 1.toByte().toString(radix = 1) }
} }
@kotlin.jvm.JvmVersion
@Test fun shortToStringWithRadix() { @Test fun shortToStringWithRadix() {
assertEquals("7FFF", 0x7FFF.toShort().toString(radix = 16).toUpperCase()) assertEquals("7FFF", 0x7FFF.toShort().toString(radix = 16).toUpperCase())
assertEquals("-8000", (-0x8000).toShort().toString(radix = 16)) assertEquals("-8000", (-0x8000).toShort().toString(radix = 16))
@@ -70,7 +63,6 @@ class StringNumberConversionJVMTest {
assertFailsWith<IllegalArgumentException>("Expected to fail with radix 1") { 1.toShort().toString(radix = 1) } assertFailsWith<IllegalArgumentException>("Expected to fail with radix 1") { 1.toShort().toString(radix = 1) }
} }
@kotlin.jvm.JvmVersion
@Test fun intToStringWithRadix() { @Test fun intToStringWithRadix() {
assertEquals("-ff", (-255).toString(radix = 16)) assertEquals("-ff", (-255).toString(radix = 16))
assertEquals("1100110", 102.toString(radix = 2)) assertEquals("1100110", 102.toString(radix = 2))
@@ -80,7 +72,6 @@ class StringNumberConversionJVMTest {
} }
@kotlin.jvm.JvmVersion
@Test fun longToStringWithRadix() { @Test fun longToStringWithRadix() {
assertEquals("7f11223344556677", 0x7F11223344556677.toString(radix = 16)) assertEquals("7f11223344556677", 0x7F11223344556677.toString(radix = 16))
assertEquals("hazelnut", 1356099454469L.toString(radix = 36)) assertEquals("hazelnut", 1356099454469L.toString(radix = 36))
@@ -90,7 +81,6 @@ class StringNumberConversionJVMTest {
assertFailsWith<IllegalArgumentException>("Expected to fail with radix 1") { 1L.toString(radix = 1) } assertFailsWith<IllegalArgumentException>("Expected to fail with radix 1") { 1L.toString(radix = 1) }
} }
@kotlin.jvm.JvmVersion
@Test fun toBigInteger() { @Test fun toBigInteger() {
compareConversion(String::toBigInteger, String::toBigIntegerOrNull) { compareConversion(String::toBigInteger, String::toBigIntegerOrNull) {
assertProduces("0", java.math.BigInteger.ZERO) assertProduces("0", java.math.BigInteger.ZERO)
@@ -118,7 +108,6 @@ class StringNumberConversionJVMTest {
} }
} }
@kotlin.jvm.JvmVersion
@Test fun toBigDecimal() { @Test fun toBigDecimal() {
fun bd(value: String) = java.math.BigDecimal(value) fun bd(value: String) = java.math.BigDecimal(value)
compareConversion(String::toBigDecimal, String::toBigDecimalOrNull) { compareConversion(String::toBigDecimal, String::toBigDecimalOrNull) {
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:JvmVersion
package test.utils package test.utils
import kotlin.test.* import kotlin.test.*
@@ -1,4 +1,3 @@
@file:kotlin.jvm.JvmVersion
package test.utils package test.utils
@@ -72,8 +72,6 @@ fun List<MemberBuilder>.writeTo(file: File, platformSource: PlatformSourceFile)
} }
writer.appendln("@file:kotlin.jvm.JvmName(\"${sourceFile.jvmClassName}\")") writer.appendln("@file:kotlin.jvm.JvmName(\"${sourceFile.jvmClassName}\")")
if (platform == Platform.JVM)
writer.appendln("@file:kotlin.jvm.JvmVersion")
writer.appendln() writer.appendln()
writer.append("package ${sourceFile.packageName ?: "kotlin"}\n\n") writer.append("package ${sourceFile.packageName ?: "kotlin"}\n\n")