summaryrefslogtreecommitdiff
path: root/formats/json-tests
diff options
context:
space:
mode:
authorAbduqodiri Qurbonzoda <a.qurbonzoda@gmail.com>2023-06-23 16:03:55 +0300
committerGitHub <noreply@github.com>2023-06-23 15:03:55 +0200
commitd192d244a7188d24e1dbf2e79ff33ea984e63e04 (patch)
treefcb5b6909363b94b036f32920fbf101a1df9c195 /formats/json-tests
parent39918cb2382b5e069f25d70fbc0a2665074be56c (diff)
downloadkotlinx.serialization-d192d244a7188d24e1dbf2e79ff33ea984e63e04.tar.gz
Fix Kotlin user projects build (#2341)
* Remove @SharedImmutable usages The annotation is deprecated and has no effect. * Suppress animal sniffer error in a data class with boolean property The error is a result of changes in data class hashCode generation. The generated code now uses the static Boolean.hashCode() to calculate hash code of boolean properties. The static function is available only since Java 1.8.
Diffstat (limited to 'formats/json-tests')
-rw-r--r--formats/json-tests/commonTest/src/kotlinx/serialization/PolymorphismTestData.kt1
-rw-r--r--formats/json-tests/commonTest/src/kotlinx/serialization/UmbrellaTypes.kt1
-rw-r--r--formats/json-tests/commonTest/src/kotlinx/serialization/json/polymorphic/PolymorphicClasses.kt3
-rw-r--r--formats/json-tests/nativeTest/src/kotlinx/serialization/test/CurrentPlatform.kt3
4 files changed, 0 insertions, 8 deletions
diff --git a/formats/json-tests/commonTest/src/kotlinx/serialization/PolymorphismTestData.kt b/formats/json-tests/commonTest/src/kotlinx/serialization/PolymorphismTestData.kt
index 6d4d42f2..a185ccb7 100644
--- a/formats/json-tests/commonTest/src/kotlinx/serialization/PolymorphismTestData.kt
+++ b/formats/json-tests/commonTest/src/kotlinx/serialization/PolymorphismTestData.kt
@@ -37,7 +37,6 @@ class PolyDefaultWithId(id: Int) : PolyBase(id)
@Serializable
data class PolyDerived(val s: String) : PolyBase(1)
-@SharedImmutable
val BaseAndDerivedModule = SerializersModule {
polymorphic(PolyBase::class, PolyBase.serializer()) {
subclass(PolyDerived.serializer())
diff --git a/formats/json-tests/commonTest/src/kotlinx/serialization/UmbrellaTypes.kt b/formats/json-tests/commonTest/src/kotlinx/serialization/UmbrellaTypes.kt
index 5e6432ea..52ab0f27 100644
--- a/formats/json-tests/commonTest/src/kotlinx/serialization/UmbrellaTypes.kt
+++ b/formats/json-tests/commonTest/src/kotlinx/serialization/UmbrellaTypes.kt
@@ -64,7 +64,6 @@ data class ArraysUmbrella(
arrIntData.contentEquals(other.arrIntData)
}
-@SharedImmutable
val umbrellaInstance = TypesUmbrella(
Unit, true, 10, 20, 30, 40, 50.1f, 60.1, 'A', "Str0", Attitude.POSITIVE, IntData(70),
null, null, 11, 21, 31, 41, 51.1f, 61.1, 'B', "Str1", Attitude.NEUTRAL, null,
diff --git a/formats/json-tests/commonTest/src/kotlinx/serialization/json/polymorphic/PolymorphicClasses.kt b/formats/json-tests/commonTest/src/kotlinx/serialization/json/polymorphic/PolymorphicClasses.kt
index e46de17a..e70d89c3 100644
--- a/formats/json-tests/commonTest/src/kotlinx/serialization/json/polymorphic/PolymorphicClasses.kt
+++ b/formats/json-tests/commonTest/src/kotlinx/serialization/json/polymorphic/PolymorphicClasses.kt
@@ -38,7 +38,6 @@ internal data class OuterBox(@Polymorphic val outerBase: OuterBase, @Polymorphic
@Serializable
internal data class OuterNullableBox(@Polymorphic val outerBase: OuterBase?, @Polymorphic val innerBase: InnerBase?)
-@SharedImmutable
internal val polymorphicTestModule = SerializersModule {
polymorphic(InnerBase::class) {
subclass(InnerImpl.serializer())
@@ -51,13 +50,11 @@ internal val polymorphicTestModule = SerializersModule {
}
}
-@SharedImmutable
internal val polymorphicJson = Json {
serializersModule = polymorphicTestModule
encodeDefaults = true
}
-@SharedImmutable
internal val polymorphicRelaxedJson = Json {
isLenient = true
serializersModule = polymorphicTestModule
diff --git a/formats/json-tests/nativeTest/src/kotlinx/serialization/test/CurrentPlatform.kt b/formats/json-tests/nativeTest/src/kotlinx/serialization/test/CurrentPlatform.kt
index 32806c1f..58249044 100644
--- a/formats/json-tests/nativeTest/src/kotlinx/serialization/test/CurrentPlatform.kt
+++ b/formats/json-tests/nativeTest/src/kotlinx/serialization/test/CurrentPlatform.kt
@@ -4,8 +4,5 @@
package kotlinx.serialization.test
-import kotlin.native.concurrent.SharedImmutable
-
-@SharedImmutable
public actual val currentPlatform: Platform = Platform.NATIVE