[K/N] Deprecate SharedImmutable annotation #KT-57837

As a part of efforts to stabilize Native stdlib.
This commit is contained in:
Abduqodiri Qurbonzoda
2023-06-16 19:20:11 +03:00
committed by Space Team
parent 0cfb80144a
commit 4ae19b2b44
31 changed files with 11 additions and 63 deletions
@@ -33,6 +33,8 @@ public expect annotation class ThreadLocal()
*
* Since 1.7.20 usage of this annotation is deprecated. See https://kotlinlang.org/docs/native-migration-guide.html for details.
*/
@Deprecated("This annotation is redundant and has no effect")
@DeprecatedSinceKotlin(warningSince = "1.9")
@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.BINARY)
// Not @FreezingIsDeprecated: Lots of usages, only the doc updated.
@@ -5,8 +5,6 @@
package kotlin.io.encoding
import kotlin.native.concurrent.SharedImmutable
// Benchmarks repository: https://github.com/qurbonzoda/KotlinBase64Benchmarks
/**
@@ -568,7 +566,6 @@ public open class Base64 private constructor(
// "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
@SharedImmutable
private val base64EncodeMap = byteArrayOf(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 0 - 15 */
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, /* 16 - 31 */
@@ -577,7 +574,6 @@ private val base64EncodeMap = byteArrayOf(
)
@ExperimentalEncodingApi
@SharedImmutable
private val base64DecodeMap = IntArray(256).apply {
this.fill(-1)
this[Base64.padSymbol.toInt()] = -2
@@ -587,7 +583,6 @@ private val base64DecodeMap = IntArray(256).apply {
}
// "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
@SharedImmutable
private val base64UrlEncodeMap = byteArrayOf(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 0 - 15 */
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, /* 16 - 31 */
@@ -596,7 +591,6 @@ private val base64UrlEncodeMap = byteArrayOf(
)
@ExperimentalEncodingApi
@SharedImmutable
private val base64UrlDecodeMap = IntArray(256).apply {
this.fill(-1)
this[Base64.padSymbol.toInt()] = -2
@@ -5,13 +5,10 @@
package kotlin.text
import kotlin.native.concurrent.SharedImmutable
private const val LOWER_CASE_HEX_DIGITS = "0123456789abcdef"
private const val UPPER_CASE_HEX_DIGITS = "0123456789ABCDEF"
// case-insensitive parsing
@SharedImmutable
private val HEX_DIGITS_TO_DECIMAL = IntArray(128) { -1 }.apply {
LOWER_CASE_HEX_DIGITS.forEachIndexed { index, char -> this[char.code] = index }
UPPER_CASE_HEX_DIGITS.forEachIndexed { index, char -> this[char.code] = index }
@@ -7,7 +7,6 @@ package kotlin
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
import kotlin.native.concurrent.SharedImmutable
/**
* Defines deep recursive function that keeps its stack on the heap,
@@ -124,7 +123,6 @@ public sealed class DeepRecursiveScope<T, R> {
private typealias DeepRecursiveFunctionBlock = suspend DeepRecursiveScope<*, *>.(Any?) -> Any?
@SharedImmutable
private val UNDEFINED_RESULT = Result.success(COROUTINE_SUSPENDED)
@Suppress("UNCHECKED_CAST")
@@ -5,7 +5,6 @@
package test.comparisons
import kotlin.native.concurrent.SharedImmutable
import kotlin.test.*
data class Item(val name: String, val rating: Int) : Comparable<Item> {
@@ -14,7 +13,6 @@ data class Item(val name: String, val rating: Int) : Comparable<Item> {
}
}
@SharedImmutable
val STRING_CASE_INSENSITIVE_ORDER: Comparator<String> =
compareBy { it: String -> it.uppercase() }.thenBy { it.lowercase() }.thenBy { it }
-2
View File
@@ -10,7 +10,6 @@ import test.*
import test.collections.behaviors.iteratorBehavior
import test.collections.compare
import kotlin.math.sign
import kotlin.native.concurrent.SharedImmutable
import kotlin.random.Random
@@ -18,7 +17,6 @@ fun createString(content: String): CharSequence = content
fun createStringBuilder(content: String): CharSequence = StringBuilder((content as Any).toString()) // required for Rhino JS
@SharedImmutable
val charSequenceBuilders = listOf(::createString, ::createStringBuilder)
fun withOneCharSequenceArg(f: ((String) -> CharSequence) -> Unit) {
@@ -9,7 +9,6 @@ package test.time
import test.numbers.assertAlmostEquals
import kotlin.math.nextDown
import kotlin.math.pow
import kotlin.native.concurrent.SharedImmutable
import kotlin.test.*
import kotlin.time.*
import kotlin.random.*
@@ -21,7 +20,6 @@ import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.nanoseconds
import kotlin.time.Duration.Companion.seconds
@SharedImmutable
private val units = DurationUnit.values()
class DurationTest {