From 1b903911f1e195ab921862e9f902721de1aa1706 Mon Sep 17 00:00:00 2001 From: Clemente Date: Mon, 20 May 2024 12:03:17 +0200 Subject: [PATCH 1/7] Remove RealmObjectId --- .../kotlin/io/realm/kotlin/ext/ObjectIdExt.kt | 21 - .../io/realm/kotlin/internal/Converters.kt | 21 +- .../io/realm/kotlin/internal/ObjectIdImpl.kt | 111 ---- .../kotlin/internal/RealmObjectHelper.kt | 6 - .../internal/schema/RealmStorageTypeImpl.kt | 5 - .../kotlin/io/realm/kotlin/types/ObjectId.kt | 56 -- .../realm/kotlin/types/annotations/Index.kt | 1 - .../kotlin/types/annotations/PrimaryKey.kt | 2 +- .../io/realm/kotlin/mongodb/auth/ApiKey.kt | 13 +- .../realm/kotlin/mongodb/auth/ApiKeyAuth.kt | 45 -- .../kotlin/mongodb/internal/ApiKeyAuthImpl.kt | 10 - .../kotlin/mongodb/internal/BsonEncoder.kt | 6 - .../kotlin/mongodb/sync/SyncConfiguration.kt | 24 +- .../compiler/AccessorModifierIrGeneration.kt | 28 - .../io/realm/kotlin/compiler/Identifiers.kt | 1 - ...RealmModelSyntheticPropertiesGeneration.kt | 4 - .../compiler/GenerationExtensionTest.kt | 7 - .../01_AFTER.ValidateIrBeforeLowering.ir | 477 +----------------- .../src/test/resources/sample/input/Sample.kt | 9 +- .../io/realm/kotlin/entities/Nullability.kt | 2 - .../kotlin/io/realm/kotlin/entities/Sample.kt | 11 +- .../kotlin/entities/SampleWithPrimaryKey.kt | 5 - .../dictionary/RealmDictionaryContainer.kt | 5 - .../entities/list/RealmListContainer.kt | 5 - .../kotlin/entities/primarykey/PrimaryKey.kt | 11 - .../entities/schema/SchemaVariations.kt | 5 - .../kotlin/entities/set/RealmSetContainer.kt | 5 - .../realm/kotlin/test/util/TypeDescriptor.kt | 4 +- .../kotlin/test/common/BsonObjectIdTests.kt | 14 +- .../kotlin/test/common/CopyFromRealmTests.kt | 5 - .../realm/kotlin/test/common/ImportTests.kt | 2 - .../kotlin/test/common/NullabilityTests.kt | 2 - .../realm/kotlin/test/common/ObjectIdTests.kt | 241 --------- .../kotlin/test/common/PersistedNameTests.kt | 17 - .../kotlin/test/common/PrimaryKeyTests.kt | 9 - .../io/realm/kotlin/test/common/QueryTests.kt | 41 -- .../test/common/RealmDictionaryTests.kt | 6 - .../kotlin/test/common/RealmListTests.kt | 5 - .../realm/kotlin/test/common/RealmSetTests.kt | 2 - .../kotlin/test/common/SerializationTests.kt | 17 - .../dynamic/DynamicMutableRealmObjectTests.kt | 166 ++---- .../common/dynamic/DynamicRealmObjectTests.kt | 253 +++------- .../kotlin/test/compiler/FullTextTests.kt | 3 - .../realm/kotlin/test/compiler/IndexTests.kt | 3 - .../kotlin/test/compiler/PrimaryKeyTests.kt | 3 - .../io/realm/kotlin/test/compiler/Utils.kt | 2 +- .../entities/sync/SyncObjectWithAllTypes.kt | 18 +- .../realm/kotlin/entities/sync/SyncPerson.kt | 4 +- .../entities/sync/flx/FlexChildObject.kt | 4 +- .../test/mongodb/common/ApiKeyAuthTests.kt | 18 +- .../test/mongodb/common/FunctionsTests.kt | 2 - .../test/mongodb/common/SyncConfigTests.kt | 14 +- .../common/serializer/BsonEncoderTests.kt | 9 - 53 files changed, 163 insertions(+), 1597 deletions(-) delete mode 100644 packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/ObjectIdExt.kt delete mode 100644 packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt delete mode 100644 packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/ObjectId.kt delete mode 100644 packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ObjectIdTests.kt diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/ObjectIdExt.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/ObjectIdExt.kt deleted file mode 100644 index c15c91f93e..0000000000 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/ObjectIdExt.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2022 Realm Inc. - * 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. - * - */ -package io.realm.kotlin.ext - -import io.realm.kotlin.internal.ObjectIdImpl -import io.realm.kotlin.types.ObjectId -import org.mongodb.kbson.BsonObjectId - -public fun ObjectId.asBsonObjectId(): BsonObjectId = BsonObjectId((this as ObjectIdImpl).bytes) diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt index e13858fc0c..84ca1eb9e1 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt @@ -33,7 +33,6 @@ import io.realm.kotlin.internal.interop.RealmValue import io.realm.kotlin.internal.interop.Timestamp import io.realm.kotlin.internal.interop.ValueType import io.realm.kotlin.types.BaseRealmObject -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject @@ -99,8 +98,7 @@ public inline fun realmValueToFloat(transport: RealmValue): Float = transport.ge public inline fun realmValueToDouble(transport: RealmValue): Double = transport.getDouble() public inline fun realmValueToObjectId(transport: RealmValue): BsonObjectId = BsonObjectId(transport.getObjectIdBytes()) -public inline fun realmValueToRealmObjectId(transport: RealmValue): ObjectId = - ObjectIdImpl(transport.getObjectIdBytes()) + public inline fun realmValueToRealmUUID(transport: RealmValue): RealmUUID = RealmUUIDImpl(transport.getUUIDBytes()) @OptIn(ExperimentalUnsignedTypes::class) public inline fun realmValueToDecimal128(transport: RealmValue): Decimal128 = @@ -316,22 +314,7 @@ internal object ObjectIdConverter : PassThroughPublicConverter() { override inline fun MemTrackingAllocator.toRealmValue(value: BsonObjectId?): RealmValue = objectIdTransport(value?.toByteArray()) } - -// Top level methods to allow inlining from compiler plugin -public inline fun objectIdToRealmObjectId(value: BsonObjectId?): ObjectId? = - value?.let { ObjectIdImpl(it.toByteArray()) } - -internal object RealmObjectIdConverter : PassThroughPublicConverter() { - override inline fun fromRealmValue(realmValue: RealmValue): ObjectId? = - if (realmValue.isNull()) null else realmValueToRealmObjectId(realmValue) - - override inline fun MemTrackingAllocator.toRealmValue(value: ObjectId?): RealmValue = - objectIdTransport(value?.let { it as ObjectIdImpl }?.bytes) -} - // Top level methods to allow inlining from compiler plugin -public inline fun realmObjectIdToObjectId(value: ObjectId?): BsonObjectId? = - value?.let { BsonObjectId((it as ObjectIdImpl).bytes) } internal object RealmUUIDConverter : PassThroughPublicConverter() { override inline fun fromRealmValue(realmValue: RealmValue): RealmUUID? = @@ -365,8 +348,6 @@ internal val primitiveTypeConverters: Map, RealmValueConverter<*>> = RealmInstant::class to RealmInstantConverter, RealmInstantImpl::class to RealmInstantConverter, BsonObjectId::class to ObjectIdConverter, - ObjectId::class to RealmObjectIdConverter, - ObjectIdImpl::class to RealmObjectIdConverter, RealmUUID::class to RealmUUIDConverter, RealmUUIDImpl::class to RealmUUIDConverter, ByteArray::class to ByteArrayConverter, diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt deleted file mode 100644 index 03671a504b..0000000000 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt +++ /dev/null @@ -1,111 +0,0 @@ -package io.realm.kotlin.internal - -import io.realm.kotlin.internal.interop.OBJECT_ID_BYTES_SIZE -import io.realm.kotlin.internal.platform.epochInSeconds -import io.realm.kotlin.internal.util.HEX_PATTERN -import io.realm.kotlin.internal.util.parseHex -import io.realm.kotlin.types.ObjectId -import io.realm.kotlin.types.RealmInstant -import kotlin.time.Duration.Companion.nanoseconds -import kotlin.time.Duration.Companion.seconds - -private fun RealmInstant.toEpochMillis(): Long = (epochSeconds.seconds + nanosecondsOfSecond.nanoseconds).inWholeMilliseconds - -// Public as constructor is inlined in accessor converter method (Converters.kt) -public class ObjectIdImpl : ObjectId { - - private val inner: org.mongodb.kbson.ObjectId - - /** - * Represents an ObjectID from an array of 12 bytes. - */ - public val bytes: ByteArray - get() = inner.toByteArray() - - /** - * Constructs a new instance using the given timestamp. - * - * @param timestamp the timestamp. - */ - public constructor( - timestamp: RealmInstant = RealmInstant.from(epochInSeconds(), 0) - ) : this(org.mongodb.kbson.ObjectId(timestamp.toEpochMillis())) - - /** - * Constructs a new instance using the given timestamp. - * - * @param epochSeconds the number of seconds since the Unix epoch - */ - public constructor(epochSeconds: Int) : this(org.mongodb.kbson.ObjectId(epochSeconds.seconds.inWholeMilliseconds)) - - /** - * Constructs a new instance from a 24-byte hexadecimal string representation. - * - * @param hexString the string to convert - * @throws IllegalArgumentException if the string is not a valid hex string representation of an ObjectId - */ - public constructor(hexString: String) : this(parseObjectIdString(hexString)) - - /** - * Constructs a new instance from the given unsigned byte array - * - * @param bytes the ByteBuffer - * @throws IllegalArgumentException if the buffer is null or does not have at least 12 bytes remaining - */ - public constructor(bytes: ByteArray) { - if (bytes.size != OBJECT_ID_BYTES_SIZE) { - throw IllegalArgumentException("byte array size must be $OBJECT_ID_BYTES_SIZE") - } - this.inner = org.mongodb.kbson.ObjectId(bytes) - } - - private constructor(inner: org.mongodb.kbson.ObjectId) { - this.inner = inner - } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other == null || this::class != other::class) return false - - other as ObjectIdImpl - - if (inner != other.inner) return false - - return true - } - - override fun hashCode(): Int = inner.hashCode() - - override operator fun compareTo(other: ObjectId): Int { - for (i in 0 until OBJECT_ID_BYTES_SIZE) { - if (this.bytes[i] != (other as ObjectIdImpl).bytes[i]) { - return if (this.bytes[i] < other.bytes[i]) -1 else 1 - } - } - return 0 - } - - override fun toString(): String { - return inner.toHexString() - } - - private companion object { - private val OBJECT_ID_REGEX by lazy { - "$HEX_PATTERN{24}".toRegex() - } - - /** - * Checks if a string could be an `ObjectId`. - * - * @param hexString a potential ObjectId as a String. - * @return whether the string could be an object id - * @throws IllegalArgumentException if hexString is null - */ - private fun parseObjectIdString(hexString: String): ByteArray { - if (!OBJECT_ID_REGEX.matches(hexString)) { - throw IllegalArgumentException("invalid hexadecimal representation of an ObjectId: [$hexString]") - } - return hexString.parseHex() - } - } -} diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt index 1b9ce15a8e..1b210bf165 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt @@ -56,7 +56,6 @@ import io.realm.kotlin.schema.RealmStorageType import io.realm.kotlin.types.BaseRealmObject import io.realm.kotlin.types.EmbeddedRealmObject import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -212,11 +211,6 @@ internal object RealmObjectHelper { key, objectIdTransport(value.toByteArray()) ) - is ObjectId -> setValueTransportByKey( - obj, - key, - objectIdTransport((value as ObjectIdImpl).bytes) - ) is RealmUUID -> setValueTransportByKey(obj, key, uuidTransport(value.bytes)) is RealmObjectInterop -> setValueTransportByKey( obj, diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt index 523de2e116..d5fbf82461 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt @@ -18,7 +18,6 @@ package io.realm.kotlin.internal.schema import io.realm.kotlin.dynamic.DynamicMutableRealmObject import io.realm.kotlin.dynamic.DynamicRealmObject -import io.realm.kotlin.internal.ObjectIdImpl import io.realm.kotlin.internal.RealmAnyImpl import io.realm.kotlin.internal.RealmInstantImpl import io.realm.kotlin.internal.RealmUUIDImpl @@ -26,11 +25,9 @@ import io.realm.kotlin.internal.dynamic.DynamicUnmanagedRealmObject import io.realm.kotlin.internal.interop.PropertyType import io.realm.kotlin.schema.RealmStorageType import io.realm.kotlin.types.BaseRealmObject -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmUUID -import org.mongodb.kbson.BsonObjectId import kotlin.reflect.KClass internal object RealmStorageTypeImpl { @@ -56,8 +53,6 @@ internal object RealmStorageTypeImpl { } internal fun KClass.realmStorageType(): KClass<*> = when (this) { - ObjectIdImpl::class -> BsonObjectId::class - ObjectId::class -> BsonObjectId::class RealmUUIDImpl::class -> RealmUUID::class RealmInstantImpl::class -> RealmInstant::class DynamicRealmObject::class, diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/ObjectId.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/ObjectId.kt deleted file mode 100644 index f9a316460a..0000000000 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/ObjectId.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 Realm Inc. - * 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. - * - */ -package io.realm.kotlin.types - -import io.realm.kotlin.internal.ObjectIdImpl - -/** - * A globally unique identifier for objects. - * - * Consists of 12 bytes, divided as follows: - * A 4-byte timestamp, representing the ObjectId's creation, measured in seconds since the Unix epoch. - * A 5-byte random value generated once per process. This random value is unique to the machine and process. - * A 3-byte incrementing counter, initialized to a random value. - */ -@Deprecated("Use BSON ObjectId instead", ReplaceWith("org.mongodb.kbson.ObjectId")) -public interface ObjectId : Comparable { - public companion object { - /** - * Generates a new [ObjectId] using the hexadecimal representation of the 12 bytes. - * - * @param hexString the string to convert. - */ - public fun from(hexString: String): ObjectId = ObjectIdImpl(hexString) - - /** - * Generates a new [ObjectId] using the provided timestamp. - * - * @param date timestamp to be used. - */ - public fun from(date: RealmInstant): ObjectId = ObjectIdImpl(date) - - /** - * Generates a new [ObjectId] using the unique 12 bytes representation. - * - * @param bytes to use as backing representation - */ - public fun from(bytes: ByteArray): ObjectId = ObjectIdImpl(bytes) - - /** - * Generates a new [ObjectId] using default values (current time) - */ - public fun create(): ObjectId = ObjectIdImpl() - } -} diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/Index.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/Index.kt index 15e8accb19..eaed94f8c6 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/Index.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/Index.kt @@ -16,7 +16,6 @@ package io.realm.kotlin.types.annotations -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmUUID import org.mongodb.kbson.BsonObjectId diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/PrimaryKey.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/PrimaryKey.kt index 5f28981737..68260c8904 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/PrimaryKey.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/PrimaryKey.kt @@ -29,7 +29,7 @@ import io.realm.kotlin.types.RealmUUID * identify the object. * * This annotation applies to the following primitive types: String, Byte, Char, - * Short, Int, Long, [io.realm.kotlin.types.ObjectId], [org.mongodb.kbson.ObjectId] and [RealmUUID], + * Short, Int, Long, [org.mongodb.kbson.ObjectId] and [RealmUUID], * as well as their nullable variants. * * It cannot be applied on a property that also has a [FullText] annotation. diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKey.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKey.kt index b274629195..b35a1d07ec 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKey.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKey.kt @@ -15,9 +15,7 @@ */ package io.realm.kotlin.mongodb.auth -import io.realm.kotlin.ext.asBsonObjectId import io.realm.kotlin.mongodb.User -import io.realm.kotlin.types.ObjectId import org.mongodb.kbson.BsonObjectId /** @@ -28,7 +26,7 @@ import org.mongodb.kbson.BsonObjectId * [ApiKeyAuth.fetchAll] will have a `null` [value]. Anyone creating an API key is responsible for * storing it safely after that. * - * @param id an [ObjectId] uniquely identifying the key. + * @param id an [BsonObjectId] uniquely identifying the key. * @param value the value of this key, only returned when the key is created, `null` otherwise. * @param name the name of the key. * @param enabled whether the key is enabled or not. @@ -38,11 +36,4 @@ public data class ApiKey internal constructor( public val value: String?, public val name: String, public val enabled: Boolean -) { - internal constructor( - id: ObjectId, - value: String?, - name: String, - enabled: Boolean - ) : this(id.asBsonObjectId(), value, name, enabled) -} +) diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKeyAuth.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKeyAuth.kt index dcad46e308..bf340a7714 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKeyAuth.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/auth/ApiKeyAuth.kt @@ -18,7 +18,6 @@ package io.realm.kotlin.mongodb.auth import io.realm.kotlin.mongodb.App import io.realm.kotlin.mongodb.User import io.realm.kotlin.mongodb.exceptions.AppException -import io.realm.kotlin.types.ObjectId import org.mongodb.kbson.BsonObjectId /** @@ -50,50 +49,6 @@ public interface ApiKeyAuth { */ public suspend fun create(name: String): ApiKey - /** - * Deletes a specific API key created by the user. - * Returns silently if no key is deleted. - * - * @param id the id of the key to delete. - * - * @throws io.realm.kotlin.mongodb.exceptions.ServiceException for failures that can happen when - * communicating with App Services. See [AppException] for details. - */ - public suspend fun delete(id: ObjectId) - - /** - * Deletes a specific API key created by the user. The function would complete normally if the provided key does not exist. - * - * @param id the id of the key to disable. - * - * @throws IllegalArgumentException if a non existing API key is disabled. - * @throws io.realm.kotlin.mongodb.exceptions.ServiceException for other failures that can happen when - * communicating with App Services. See [AppException] for details. - */ - public suspend fun disable(id: ObjectId) - - /** - * Enables a specific API key created by the user. - * - * @param id the id of the key to disable. - * - * @throws IllegalArgumentException if a non existing API key is enabled. - * @throws io.realm.kotlin.mongodb.exceptions.ServiceException for other failures that can happen when - * communicating with App Services. See [AppException] for details. - */ - public suspend fun enable(id: ObjectId) - - /** - * Fetches a specific user API key associated with the user. - * - * @param id the id of the key to fetch. - * - * @throws IllegalArgumentException if a non existing API key is fetched. - * @throws io.realm.kotlin.mongodb.exceptions.ServiceException for other failures that can happen when - * communicating with App Services. See [AppException] for details. - */ - public suspend fun fetch(id: ObjectId): ApiKey? - /** * Deletes a specific API key created by the user. * Returns silently if no key is deleted. diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/ApiKeyAuthImpl.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/ApiKeyAuthImpl.kt index 86d946658d..f7ff26fc29 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/ApiKeyAuthImpl.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/ApiKeyAuthImpl.kt @@ -15,7 +15,6 @@ */ package io.realm.kotlin.mongodb.internal -import io.realm.kotlin.ext.asBsonObjectId import io.realm.kotlin.internal.interop.ErrorCode import io.realm.kotlin.internal.interop.RealmInterop import io.realm.kotlin.internal.interop.sync.ApiKeyWrapper @@ -23,7 +22,6 @@ import io.realm.kotlin.internal.util.use import io.realm.kotlin.mongodb.auth.ApiKey import io.realm.kotlin.mongodb.auth.ApiKeyAuth import io.realm.kotlin.mongodb.exceptions.ServiceException -import io.realm.kotlin.types.ObjectId import kotlinx.coroutines.channels.Channel import org.mongodb.kbson.BsonObjectId @@ -64,8 +62,6 @@ internal class ApiKeyAuthImpl(override val app: AppImpl, override val user: User } } - override suspend fun delete(id: ObjectId) = delete(id.asBsonObjectId()) - override suspend fun delete(id: BsonObjectId) { try { Channel>(1).use { channel -> @@ -88,8 +84,6 @@ internal class ApiKeyAuthImpl(override val app: AppImpl, override val user: User } } - override suspend fun disable(id: ObjectId) = disable(id.asBsonObjectId()) - override suspend fun disable(id: BsonObjectId) { try { Channel>(1).use { channel -> @@ -113,8 +107,6 @@ internal class ApiKeyAuthImpl(override val app: AppImpl, override val user: User } } - override suspend fun enable(id: ObjectId) = enable(id.asBsonObjectId()) - override suspend fun enable(id: BsonObjectId) { try { Channel>(1).use { channel -> @@ -138,8 +130,6 @@ internal class ApiKeyAuthImpl(override val app: AppImpl, override val user: User } } - override suspend fun fetch(id: ObjectId): ApiKey? = fetch(id.asBsonObjectId()) - override suspend fun fetch(id: BsonObjectId): ApiKey? { try { Channel>(1).use { channel -> diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BsonEncoder.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BsonEncoder.kt index c676fbbbcf..87f2daf2dd 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BsonEncoder.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BsonEncoder.kt @@ -18,11 +18,9 @@ package io.realm.kotlin.mongodb.internal import io.realm.kotlin.ext.asRealmObject -import io.realm.kotlin.internal.ObjectIdImpl import io.realm.kotlin.internal.toDuration import io.realm.kotlin.internal.toRealmInstant import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmUUID @@ -172,9 +170,6 @@ internal object BsonEncoder { } RealmUUID.from(bsonBinary.data) } - ObjectId::class -> { - ObjectId.from(bsonValue.asObjectId().toByteArray()) - } RealmInstant::class -> { bsonValue.asDateTime().value.milliseconds.toRealmInstant() } @@ -265,7 +260,6 @@ internal object BsonEncoder { is ByteArray -> BsonBinary(BsonBinarySubType.BINARY, value) is MutableRealmInt -> BsonInt64(value.toLong()) is RealmUUID -> BsonBinary(BsonBinarySubType.UUID_STANDARD, value.bytes) - is ObjectId -> BsonObjectId((value as ObjectIdImpl).bytes) is RealmInstant -> BsonDateTime(value.toDuration().inWholeMilliseconds) is BsonValue -> value null -> BsonNull diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt index 943a6d610c..b2c53632a1 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt @@ -21,7 +21,6 @@ import io.realm.kotlin.Realm import io.realm.kotlin.TypedRealm import io.realm.kotlin.internal.ConfigurationImpl import io.realm.kotlin.internal.ContextLogger -import io.realm.kotlin.internal.ObjectIdImpl import io.realm.kotlin.internal.interop.RealmInterop import io.realm.kotlin.internal.interop.SchemaMode import io.realm.kotlin.internal.platform.PATH_SEPARATOR @@ -35,7 +34,6 @@ import io.realm.kotlin.mongodb.exceptions.SyncException import io.realm.kotlin.mongodb.internal.SyncConfigurationImpl import io.realm.kotlin.mongodb.internal.UserImpl import io.realm.kotlin.types.BaseRealmObject -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmUUID import org.mongodb.kbson.BsonBinary import org.mongodb.kbson.BsonBinarySubType @@ -241,26 +239,6 @@ public interface SyncConfiguration : Configuration { schema: Set> ) : this(user, schema, null) - /** - * Creates a [SyncConfiguration.Builder] for Partition-Based Sync. Partition-Based Sync - * must be enabled on the server for this to work. - * - * **See:** [Partitions](https://www.mongodb.com/docs/realm/sync/data-access-patterns/partitions/) - * - * @param user user used to access server side data. This will define which data is - * available from the server. - * @param partitionValue the partition value to use data from. The server must have been - * configured with an [ObjectId](https://www.mongodb.com/docs/v4.4/reference/method/ObjectId/) partition key for this to work. - * @param schema the classes of the schema. The elements of the set must be direct class - * literals. - * **See:** [partition key](https://www.mongodb.com/docs/realm/sync/data-access-patterns/partitions/) - */ - public constructor( - user: User, - partitionValue: ObjectId?, - schema: Set> - ) : this(user, schema, partitionValue?.let { BsonObjectId((it as ObjectIdImpl).bytes) } ?: BsonNull) - /** * Creates a [SyncConfiguration.Builder] for Partition-Based Sync. Partition-Based Sync * must be enabled on the server for this to work. @@ -670,7 +648,7 @@ public interface SyncConfiguration : Configuration { * @throws IllegalArgumentException if the user is not valid and logged in. * * **See:** [partition key](https://www.mongodb.com/docs/realm/sync/data-access-patterns/partitions/) */ - public fun create(user: User, partitionValue: ObjectId?, schema: Set>): SyncConfiguration = + public fun create(user: User, partitionValue: BsonObjectId?, schema: Set>): SyncConfiguration = Builder(user, partitionValue, schema).build() /** diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt index d1d5115e1f..5db24b72c2 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt @@ -29,7 +29,6 @@ import io.realm.kotlin.compiler.ClassIds.REALM_INSTANT import io.realm.kotlin.compiler.ClassIds.REALM_LIST import io.realm.kotlin.compiler.ClassIds.REALM_MUTABLE_INTEGER import io.realm.kotlin.compiler.ClassIds.REALM_OBJECT_HELPER -import io.realm.kotlin.compiler.ClassIds.REALM_OBJECT_ID import io.realm.kotlin.compiler.ClassIds.REALM_OBJECT_INTERFACE import io.realm.kotlin.compiler.ClassIds.REALM_SET import io.realm.kotlin.compiler.ClassIds.REALM_UUID @@ -134,7 +133,6 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { private val objectIdClass: IrClass = pluginContext.lookupClassOrThrow(KBSON_OBJECT_ID) private val decimal128Class: IrClass = pluginContext.lookupClassOrThrow(KBSON_DECIMAL128) - private val realmObjectIdClass: IrClass = pluginContext.lookupClassOrThrow(REALM_OBJECT_ID) private val realmUUIDClass: IrClass = pluginContext.lookupClassOrThrow(REALM_UUID) private val mutableRealmIntegerClass: IrClass = pluginContext.lookupClassOrThrow(REALM_MUTABLE_INTEGER) private val realmAnyClass: IrClass = pluginContext.lookupClassOrThrow(REALM_ANY) @@ -208,8 +206,6 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { pluginContext.referenceFunctions(CallableId(FqName("io.realm.kotlin.internal"), Name.identifier("longToShort"))).first().owner private val longToInt: IrSimpleFunction = pluginContext.referenceFunctions(CallableId(FqName("io.realm.kotlin.internal"), Name.identifier("longToInt"))).first().owner - private val objectIdToRealmObjectId: IrSimpleFunction = - pluginContext.referenceFunctions(CallableId(FqName("io.realm.kotlin.internal"), Name.identifier("objectIdToRealmObjectId"))).first().owner private lateinit var objectReferenceProperty: IrProperty private lateinit var objectReferenceType: IrType @@ -599,24 +595,6 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { toRealmValue = null ) } - propertyType.isRealmObjectId() -> { - logDebug("io.realm.kotlin.types.ObjectId property named ${declaration.name} is ${if (nullable) "" else "not "}nullable") - var schemaProperty = SchemaProperty( - propertyType = PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, - declaration = declaration, - collectionType = CollectionType.NONE - ) - fields[name] = schemaProperty - modifyAccessor( - property = schemaProperty, - getFunction = getObjectId, - fromRealmValue = objectIdToRealmObjectId, - toPublic = null, - setFunction = setValue, - fromPublic = null, - toRealmValue = null - ) - } propertyType.isRealmUUID() -> { logDebug("RealmUUID property named ${declaration.name} is ${if (nullable) "" else "not "}nullable") val schemaProperty = SchemaProperty( @@ -1001,12 +979,6 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { return propertyClassId == objectIdClassId } - private fun IrType.isRealmObjectId(): Boolean { - val propertyClassId: ClassId = this.classIdOrFail() - val objectIdClassId: ClassId? = realmObjectIdClass.classId - return propertyClassId == objectIdClassId - } - private fun IrType.hasSameClassId(other: IrType): Boolean { val propertyClassId: ClassId = this.classIdOrFail() val otherClassId = other.classIdOrFail() diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt index ce6afd3774..b1db2c722e 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt @@ -156,7 +156,6 @@ object ClassIds { val REALM_INSTANT = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("RealmInstant")) val REALM_BACKLINKS = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("BacklinksDelegate")) val REALM_EMBEDDED_BACKLINKS = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("EmbeddedBacklinksDelegate")) - val REALM_OBJECT_ID = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("ObjectId")) val KBSON_OBJECT_ID = ClassId(FqNames.PACKAGE_KBSON, Name.identifier("BsonObjectId")) val KBSON_DECIMAL128 = ClassId(FqNames.PACKAGE_KBSON, Name.identifier("BsonDecimal128")) val REALM_UUID = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("RealmUUID")) diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt index 706cd49ca5..1f6948ef1e 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt @@ -33,7 +33,6 @@ import io.realm.kotlin.compiler.ClassIds.PROPERTY_TYPE import io.realm.kotlin.compiler.ClassIds.REALM_ANY import io.realm.kotlin.compiler.ClassIds.REALM_INSTANT import io.realm.kotlin.compiler.ClassIds.REALM_MODEL_COMPANION -import io.realm.kotlin.compiler.ClassIds.REALM_OBJECT_ID import io.realm.kotlin.compiler.ClassIds.REALM_OBJECT_INTERFACE import io.realm.kotlin.compiler.ClassIds.REALM_OBJECT_INTERNAL_INTERFACE import io.realm.kotlin.compiler.ClassIds.REALM_UUID @@ -145,7 +144,6 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi private val objectReferenceClass = pluginContext.lookupClassOrThrow(OBJECT_REFERENCE_CLASS) private val realmInstantType: IrType = pluginContext.lookupClassOrThrow(REALM_INSTANT).defaultType - private val realmObjectIdType: IrType = pluginContext.lookupClassOrThrow(REALM_OBJECT_ID).defaultType private val objectIdType: IrType = pluginContext.lookupClassOrThrow(KBSON_OBJECT_ID).defaultType private val realmUUIDType: IrType = pluginContext.lookupClassOrThrow(REALM_UUID).defaultType private val realmAnyType: IrType = pluginContext.lookupClassOrThrow(REALM_ANY).defaultType @@ -200,7 +198,6 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi longType, stringType, objectIdType, - realmObjectIdType, realmUUIDType ) } @@ -215,7 +212,6 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi stringType, realmInstantType, objectIdType, - realmObjectIdType, realmUUIDType, realmAnyType ) diff --git a/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt b/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt index b63a4de308..b0816c2e9f 100644 --- a/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt +++ b/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt @@ -191,7 +191,6 @@ class GenerationExtensionTest { "doubleField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "decimal128Field" to PropertyType.RLM_PROPERTY_TYPE_DECIMAL128, "timestampField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, - "objectIdField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "bsonObjectIdField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "uuidField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "byteArrayField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, @@ -212,7 +211,6 @@ class GenerationExtensionTest { "floatListField" to PropertyType.RLM_PROPERTY_TYPE_FLOAT, "doubleListField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "timestampListField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, - "objectIdListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "bsonObjectIdListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "uuidListField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "objectListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT, @@ -231,7 +229,6 @@ class GenerationExtensionTest { "nullableFloatListField" to PropertyType.RLM_PROPERTY_TYPE_FLOAT, "nullableDoubleListField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "nullableTimestampListField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, - "nullableObjectIdListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "nullableBsonObjectIdListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "nullableUUIDListField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "nullableBinaryListField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, @@ -249,7 +246,6 @@ class GenerationExtensionTest { "floatSetField" to PropertyType.RLM_PROPERTY_TYPE_FLOAT, "doubleSetField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "timestampSetField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, - "objectIdSetField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "bsonObjectIdSetField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "uuidSetField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "objectSetField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT, @@ -267,7 +263,6 @@ class GenerationExtensionTest { "nullableFloatSetField" to PropertyType.RLM_PROPERTY_TYPE_FLOAT, "nullableDoubleSetField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "nullableTimestampSetField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, - "nullableObjectIdSetField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "nullableBsonObjectIdSetField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "nullableUUIDSetField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "nullableBinarySetField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, @@ -285,7 +280,6 @@ class GenerationExtensionTest { "floatDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_FLOAT, "doubleDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "timestampDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, - "objectIdDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "bsonObjectIdDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "uuidDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "binaryDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, @@ -302,7 +296,6 @@ class GenerationExtensionTest { "nullableFloatDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_FLOAT, "nullableDoubleDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "nullableTimestampDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, - "nullableObjectIdDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "nullableBsonObjectIdDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, "nullableUUIDDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "nullableBinaryDictionaryField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, diff --git a/packages/plugin-compiler/src/test/resources/sample/expected/01_AFTER.ValidateIrBeforeLowering.ir b/packages/plugin-compiler/src/test/resources/sample/expected/01_AFTER.ValidateIrBeforeLowering.ir index f30a8801b5..53764b38bc 100644 --- a/packages/plugin-compiler/src/test/resources/sample/expected/01_AFTER.ValidateIrBeforeLowering.ir +++ b/packages/plugin-compiler/src/test/resources/sample/expected/01_AFTER.ValidateIrBeforeLowering.ir @@ -680,57 +680,6 @@ MODULE_FRAGMENT name:
obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="timestampField" value: GET_VAR ': io.realm.kotlin.types.RealmInstant? declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmInstant? origin=null - PROPERTY name:objectIdField visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:objectIdField type:io.realm.kotlin.types.ObjectId? visibility:private - EXPRESSION_BODY - CALL 'public final fun create (): io.realm.kotlin.types.ObjectId declared in io.realm.kotlin.types.ObjectId.Companion' type=io.realm.kotlin.types.ObjectId origin=null - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.types.ObjectId.Companion - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.ObjectId? - correspondingProperty: PROPERTY name:objectIdField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.ObjectId? declared in sample.input.Sample' - BLOCK type=io.realm.kotlin.types.ObjectId? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=io.realm.kotlin.types.ObjectId? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdField type:io.realm.kotlin.types.ObjectId? visibility:private' type=io.realm.kotlin.types.ObjectId? origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun objectIdToRealmObjectId (value: org.mongodb.kbson.BsonObjectId?): io.realm.kotlin.types.ObjectId? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.types.ObjectId? origin=null - value: CALL 'internal final fun getObjectId (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): org.mongodb.kbson.BsonObjectId? [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=org.mongodb.kbson.BsonObjectId? origin=null - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="objectIdField" - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.ObjectId?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:objectIdField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.ObjectId? - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdField type:io.realm.kotlin.types.ObjectId? visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.types.ObjectId? declared in sample.input.Sample.' type=io.realm.kotlin.types.ObjectId? origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: kotlin.Any?): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=null - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="objectIdField" - value: GET_VAR ': io.realm.kotlin.types.ObjectId? declared in sample.input.Sample.' type=io.realm.kotlin.types.ObjectId? origin=null PROPERTY name:bsonObjectIdField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:bsonObjectIdField type:org.mongodb.kbson.BsonObjectId? visibility:private EXPRESSION_BODY @@ -1553,58 +1502,6 @@ MODULE_FRAGMENT name:
obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="timestampListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null - PROPERTY name:objectIdListField visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:objectIdListField type:io.realm.kotlin.types.RealmList visibility:private - EXPRESSION_BODY - CALL 'public final fun realmListOf (vararg elements: T of io.realm.kotlin.ext.RealmListExtKt.realmListOf): io.realm.kotlin.types.RealmList declared in io.realm.kotlin.ext.RealmListExtKt' type=io.realm.kotlin.types.RealmList origin=null - : io.realm.kotlin.types.ObjectId - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmList - correspondingProperty: PROPERTY name:objectIdListField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' - BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=io.realm.kotlin.types.RealmList origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=null - : io.realm.kotlin.types.ObjectId - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="objectIdListField" - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:objectIdListField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.UnmanagedToManagedObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=null - : io.realm.kotlin.types.ObjectId - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - col: CONST String type=kotlin.String value="objectIdListField" - list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:bsonObjectIdListField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:bsonObjectIdListField type:io.realm.kotlin.types.RealmList visibility:private EXPRESSION_BODY @@ -2437,58 +2334,6 @@ MODULE_FRAGMENT name:
obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableTimestampListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null - PROPERTY name:nullableObjectIdListField visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdListField type:io.realm.kotlin.types.RealmList visibility:private - EXPRESSION_BODY - CALL 'public final fun realmListOf (vararg elements: T of io.realm.kotlin.ext.RealmListExtKt.realmListOf): io.realm.kotlin.types.RealmList declared in io.realm.kotlin.ext.RealmListExtKt' type=io.realm.kotlin.types.RealmList origin=null - : io.realm.kotlin.types.ObjectId? - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmList - correspondingProperty: PROPERTY name:nullableObjectIdListField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' - BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=io.realm.kotlin.types.RealmList origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=null - : io.realm.kotlin.types.ObjectId? - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="nullableObjectIdListField" - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:nullableObjectIdListField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.UnmanagedToManagedObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=null - : io.realm.kotlin.types.ObjectId? - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - col: CONST String type=kotlin.String value="nullableObjectIdListField" - list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableBsonObjectIdListField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:nullableBsonObjectIdListField type:io.realm.kotlin.types.RealmList visibility:private EXPRESSION_BODY @@ -3269,58 +3114,6 @@ MODULE_FRAGMENT name:
obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="timestampSetField" set: GET_VAR ': io.realm.kotlin.types.RealmSet declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmSet origin=null - PROPERTY name:objectIdSetField visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:objectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private - EXPRESSION_BODY - CALL 'public final fun realmSetOf (vararg elements: T of io.realm.kotlin.ext.RealmSetExtKt.realmSetOf): io.realm.kotlin.types.RealmSet declared in io.realm.kotlin.ext.RealmSetExtKt' type=io.realm.kotlin.types.RealmSet origin=null - : io.realm.kotlin.types.ObjectId - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmSet - correspondingProperty: PROPERTY name:objectIdSetField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmSet declared in sample.input.Sample' - BLOCK type=io.realm.kotlin.types.RealmSet origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=io.realm.kotlin.types.RealmSet origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private' type=io.realm.kotlin.types.RealmSet origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun getSet (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmSet [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmSet origin=null - : io.realm.kotlin.types.ObjectId - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="objectIdSetField" - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmSet) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:objectIdSetField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmSet - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.types.RealmSet declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmSet origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun setSet (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, set: io.realm.kotlin.types.RealmSet, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.UnmanagedToManagedObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=null - : io.realm.kotlin.types.ObjectId - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - col: CONST String type=kotlin.String value="objectIdSetField" - set: GET_VAR ': io.realm.kotlin.types.RealmSet declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmSet origin=null PROPERTY name:bsonObjectIdSetField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:bsonObjectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private EXPRESSION_BODY @@ -4101,58 +3894,6 @@ MODULE_FRAGMENT name:
obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableTimestampSetField" set: GET_VAR ': io.realm.kotlin.types.RealmSet declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmSet origin=null - PROPERTY name:nullableObjectIdSetField visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private - EXPRESSION_BODY - CALL 'public final fun realmSetOf (vararg elements: T of io.realm.kotlin.ext.RealmSetExtKt.realmSetOf): io.realm.kotlin.types.RealmSet declared in io.realm.kotlin.ext.RealmSetExtKt' type=io.realm.kotlin.types.RealmSet origin=null - : io.realm.kotlin.types.ObjectId? - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmSet - correspondingProperty: PROPERTY name:nullableObjectIdSetField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmSet declared in sample.input.Sample' - BLOCK type=io.realm.kotlin.types.RealmSet origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=io.realm.kotlin.types.RealmSet origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private' type=io.realm.kotlin.types.RealmSet origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun getSet (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmSet [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmSet origin=null - : io.realm.kotlin.types.ObjectId? - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="nullableObjectIdSetField" - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmSet) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:nullableObjectIdSetField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmSet - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.types.RealmSet declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmSet origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun setSet (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, set: io.realm.kotlin.types.RealmSet, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.UnmanagedToManagedObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=null - : io.realm.kotlin.types.ObjectId? - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - col: CONST String type=kotlin.String value="nullableObjectIdSetField" - set: GET_VAR ': io.realm.kotlin.types.RealmSet declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmSet origin=null PROPERTY name:nullableBsonObjectIdSetField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:nullableBsonObjectIdSetField type:io.realm.kotlin.types.RealmSet visibility:private EXPRESSION_BODY @@ -4933,58 +4674,6 @@ MODULE_FRAGMENT name:
obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="timestampDictionaryField" dictionary: GET_VAR ': io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmDictionary origin=null - PROPERTY name:objectIdDictionaryField visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:objectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private - EXPRESSION_BODY - CALL 'public final fun realmDictionaryOf (vararg elements: kotlin.Pair): io.realm.kotlin.types.RealmDictionary declared in io.realm.kotlin.ext.RealmDictionaryExtKt' type=io.realm.kotlin.types.RealmDictionary origin=null - : io.realm.kotlin.types.ObjectId - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmDictionary - correspondingProperty: PROPERTY name:objectIdDictionaryField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample' - BLOCK type=io.realm.kotlin.types.RealmDictionary origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=io.realm.kotlin.types.RealmDictionary origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private' type=io.realm.kotlin.types.RealmDictionary origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun getDictionary (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmDictionary [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmDictionary origin=null - : io.realm.kotlin.types.ObjectId - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="objectIdDictionaryField" - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmDictionary) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:objectIdDictionaryField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmDictionary - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmDictionary origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun setDictionary (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, dictionary: io.realm.kotlin.types.RealmDictionary, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.UnmanagedToManagedObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=null - : io.realm.kotlin.types.ObjectId - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - col: CONST String type=kotlin.String value="objectIdDictionaryField" - dictionary: GET_VAR ': io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmDictionary origin=null PROPERTY name:bsonObjectIdDictionaryField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:bsonObjectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private EXPRESSION_BODY @@ -5713,58 +5402,6 @@ MODULE_FRAGMENT name:
obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableTimestampDictionaryField" dictionary: GET_VAR ': io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmDictionary origin=null - PROPERTY name:nullableObjectIdDictionaryField visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private - EXPRESSION_BODY - CALL 'public final fun realmDictionaryOf (vararg elements: kotlin.Pair): io.realm.kotlin.types.RealmDictionary declared in io.realm.kotlin.ext.RealmDictionaryExtKt' type=io.realm.kotlin.types.RealmDictionary origin=null - : io.realm.kotlin.types.ObjectId? - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmDictionary - correspondingProperty: PROPERTY name:nullableObjectIdDictionaryField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample' - BLOCK type=io.realm.kotlin.types.RealmDictionary origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=io.realm.kotlin.types.RealmDictionary origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private' type=io.realm.kotlin.types.RealmDictionary origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun getDictionary (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmDictionary [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmDictionary origin=null - : io.realm.kotlin.types.ObjectId? - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - propertyName: CONST String type=kotlin.String value="nullableObjectIdDictionaryField" - FUN GENERATED[io.realm.kotlin.compiler.fir.RealmPluginGeneratorKey] name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmDictionary) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:nullableObjectIdDictionaryField visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmDictionary - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmDictionary origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'internal final fun setDictionary (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, dictionary: io.realm.kotlin.types.RealmDictionary, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.UnmanagedToManagedObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=null - : io.realm.kotlin.types.ObjectId? - $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null - col: CONST String type=kotlin.String value="nullableObjectIdDictionaryField" - dictionary: GET_VAR ': io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmDictionary origin=null PROPERTY name:nullableBsonObjectIdDictionaryField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:nullableBsonObjectIdDictionaryField type:io.realm.kotlin.types.RealmDictionary visibility:private EXPRESSION_BODY @@ -6340,7 +5977,7 @@ MODULE_FRAGMENT name:
$this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.ClassInfo.Companion name: CONST String type=kotlin.String value="Sample" primaryKey: CONST String type=kotlin.String value="id" - numProperties: CONST Long type=kotlin.Long value=123 + numProperties: CONST Long type=kotlin.Long value=116 isEmbedded: CONST Boolean type=kotlin.Boolean value=false isAsymmetric: CONST Boolean type=kotlin.Boolean value=false cinteropProperties: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null @@ -6478,17 +6115,6 @@ MODULE_FRAGMENT name:
isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false - CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null - name: CONST String type=kotlin.String value="objectIdField" - publicName: CONST String type=kotlin.String value="" - type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_OBJECT_ID' type=io.realm.kotlin.internal.interop.PropertyType - collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_NONE' type=io.realm.kotlin.internal.interop.CollectionType - linkTarget: CONST Null type=kotlin.reflect.KClass? value=null - linkOriginPropertyName: CONST String type=kotlin.String value="" - isNullable: CONST Boolean type=kotlin.Boolean value=true - isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false - isIndexed: CONST Boolean type=kotlin.Boolean value=false - isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null name: CONST String type=kotlin.String value="bsonObjectIdField" publicName: CONST String type=kotlin.String value="" @@ -6665,17 +6291,6 @@ MODULE_FRAGMENT name:
isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false - CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null - name: CONST String type=kotlin.String value="objectIdListField" - publicName: CONST String type=kotlin.String value="" - type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_OBJECT_ID' type=io.realm.kotlin.internal.interop.PropertyType - collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_LIST' type=io.realm.kotlin.internal.interop.CollectionType - linkTarget: CONST Null type=kotlin.reflect.KClass? value=null - linkOriginPropertyName: CONST String type=kotlin.String value="" - isNullable: CONST Boolean type=kotlin.Boolean value=false - isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false - isIndexed: CONST Boolean type=kotlin.Boolean value=false - isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null name: CONST String type=kotlin.String value="bsonObjectIdListField" publicName: CONST String type=kotlin.String value="" @@ -6852,17 +6467,6 @@ MODULE_FRAGMENT name:
isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false - CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null - name: CONST String type=kotlin.String value="nullableObjectIdListField" - publicName: CONST String type=kotlin.String value="" - type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_OBJECT_ID' type=io.realm.kotlin.internal.interop.PropertyType - collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_LIST' type=io.realm.kotlin.internal.interop.CollectionType - linkTarget: CONST Null type=kotlin.reflect.KClass? value=null - linkOriginPropertyName: CONST String type=kotlin.String value="" - isNullable: CONST Boolean type=kotlin.Boolean value=true - isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false - isIndexed: CONST Boolean type=kotlin.Boolean value=false - isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null name: CONST String type=kotlin.String value="nullableBsonObjectIdListField" publicName: CONST String type=kotlin.String value="" @@ -7028,17 +6632,6 @@ MODULE_FRAGMENT name:
isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false - CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null - name: CONST String type=kotlin.String value="objectIdSetField" - publicName: CONST String type=kotlin.String value="" - type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_OBJECT_ID' type=io.realm.kotlin.internal.interop.PropertyType - collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_SET' type=io.realm.kotlin.internal.interop.CollectionType - linkTarget: CONST Null type=kotlin.reflect.KClass? value=null - linkOriginPropertyName: CONST String type=kotlin.String value="" - isNullable: CONST Boolean type=kotlin.Boolean value=false - isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false - isIndexed: CONST Boolean type=kotlin.Boolean value=false - isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null name: CONST String type=kotlin.String value="bsonObjectIdSetField" publicName: CONST String type=kotlin.String value="" @@ -7204,17 +6797,6 @@ MODULE_FRAGMENT name:
isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false - CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null - name: CONST String type=kotlin.String value="nullableObjectIdSetField" - publicName: CONST String type=kotlin.String value="" - type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_OBJECT_ID' type=io.realm.kotlin.internal.interop.PropertyType - collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_SET' type=io.realm.kotlin.internal.interop.CollectionType - linkTarget: CONST Null type=kotlin.reflect.KClass? value=null - linkOriginPropertyName: CONST String type=kotlin.String value="" - isNullable: CONST Boolean type=kotlin.Boolean value=true - isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false - isIndexed: CONST Boolean type=kotlin.Boolean value=false - isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null name: CONST String type=kotlin.String value="nullableBsonObjectIdSetField" publicName: CONST String type=kotlin.String value="" @@ -7380,17 +6962,6 @@ MODULE_FRAGMENT name:
isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false - CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null - name: CONST String type=kotlin.String value="objectIdDictionaryField" - publicName: CONST String type=kotlin.String value="" - type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_OBJECT_ID' type=io.realm.kotlin.internal.interop.PropertyType - collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_DICTIONARY' type=io.realm.kotlin.internal.interop.CollectionType - linkTarget: CONST Null type=kotlin.reflect.KClass? value=null - linkOriginPropertyName: CONST String type=kotlin.String value="" - isNullable: CONST Boolean type=kotlin.Boolean value=false - isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false - isIndexed: CONST Boolean type=kotlin.Boolean value=false - isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null name: CONST String type=kotlin.String value="bsonObjectIdDictionaryField" publicName: CONST String type=kotlin.String value="" @@ -7545,17 +7116,6 @@ MODULE_FRAGMENT name:
isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false - CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null - name: CONST String type=kotlin.String value="nullableObjectIdDictionaryField" - publicName: CONST String type=kotlin.String value="" - type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_OBJECT_ID' type=io.realm.kotlin.internal.interop.PropertyType - collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_DICTIONARY' type=io.realm.kotlin.internal.interop.CollectionType - linkTarget: CONST Null type=kotlin.reflect.KClass? value=null - linkOriginPropertyName: CONST String type=kotlin.String value="" - isNullable: CONST Boolean type=kotlin.Boolean value=true - isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false - isIndexed: CONST Boolean type=kotlin.Boolean value=false - isFullTextIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'internal final fun createPropertyInfo (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.reflect.KClass?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean, isFullTextIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.schema.CompilerPluginBridgeUtilsKt' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null name: CONST String type=kotlin.String value="nullableBsonObjectIdDictionaryField" publicName: CONST String type=kotlin.String value="" @@ -7799,11 +7359,6 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="timestampField" second: PROPERTY_REFERENCE 'public final timestampField: io.realm.kotlin.types.RealmInstant? [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmInstant? declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmInstant?): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null - CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null - : kotlin.String - : kotlin.reflect.KMutableProperty1 - first: CONST String type=kotlin.String value="objectIdField" - second: PROPERTY_REFERENCE 'public final objectIdField: io.realm.kotlin.types.ObjectId? [var]' field=null getter='public final fun (): io.realm.kotlin.types.ObjectId? declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.ObjectId?): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -7884,11 +7439,6 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="timestampListField" second: PROPERTY_REFERENCE 'public final timestampListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null - CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null - : kotlin.String - : kotlin.reflect.KMutableProperty1 - first: CONST String type=kotlin.String value="objectIdListField" - second: PROPERTY_REFERENCE 'public final objectIdListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -7969,11 +7519,6 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="nullableTimestampListField" second: PROPERTY_REFERENCE 'public final nullableTimestampListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null - CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null - : kotlin.String - : kotlin.reflect.KMutableProperty1 - first: CONST String type=kotlin.String value="nullableObjectIdListField" - second: PROPERTY_REFERENCE 'public final nullableObjectIdListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -8049,11 +7594,6 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="timestampSetField" second: PROPERTY_REFERENCE 'public final timestampSetField: io.realm.kotlin.types.RealmSet [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmSet declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmSet): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null - CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null - : kotlin.String - : kotlin.reflect.KMutableProperty1 - first: CONST String type=kotlin.String value="objectIdSetField" - second: PROPERTY_REFERENCE 'public final objectIdSetField: io.realm.kotlin.types.RealmSet [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmSet declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmSet): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -8129,11 +7669,6 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="nullableTimestampSetField" second: PROPERTY_REFERENCE 'public final nullableTimestampSetField: io.realm.kotlin.types.RealmSet [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmSet declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmSet): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null - CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null - : kotlin.String - : kotlin.reflect.KMutableProperty1 - first: CONST String type=kotlin.String value="nullableObjectIdSetField" - second: PROPERTY_REFERENCE 'public final nullableObjectIdSetField: io.realm.kotlin.types.RealmSet [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmSet declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmSet): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -8209,11 +7744,6 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="timestampDictionaryField" second: PROPERTY_REFERENCE 'public final timestampDictionaryField: io.realm.kotlin.types.RealmDictionary [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmDictionary): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null - CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null - : kotlin.String - : kotlin.reflect.KMutableProperty1 - first: CONST String type=kotlin.String value="objectIdDictionaryField" - second: PROPERTY_REFERENCE 'public final objectIdDictionaryField: io.realm.kotlin.types.RealmDictionary [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmDictionary): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -8284,11 +7814,6 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="nullableTimestampDictionaryField" second: PROPERTY_REFERENCE 'public final nullableTimestampDictionaryField: io.realm.kotlin.types.RealmDictionary [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmDictionary): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null - CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null - : kotlin.String - : kotlin.reflect.KMutableProperty1 - first: CONST String type=kotlin.String value="nullableObjectIdDictionaryField" - second: PROPERTY_REFERENCE 'public final nullableObjectIdDictionaryField: io.realm.kotlin.types.RealmDictionary [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmDictionary declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmDictionary): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 diff --git a/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt b/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt index 23018c2718..d5bd1d7511 100644 --- a/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt +++ b/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt @@ -22,7 +22,7 @@ import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.ext.realmSetOf import io.realm.kotlin.types.EmbeddedRealmObject import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId + import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -67,7 +67,6 @@ class Sample : RealmObject { var doubleField: Double? = 1.19840122 var decimal128Field: Decimal128? = Decimal128("1.8446744073709551618E-6157") var timestampField: RealmInstant? = RealmInstant.from(0, 0) - var objectIdField: ObjectId? = ObjectId.create() var bsonObjectIdField: BsonObjectId? = BsonObjectId() var uuidField: RealmUUID? = RealmUUID.random() var byteArrayField: ByteArray? = null @@ -87,7 +86,6 @@ class Sample : RealmObject { var floatListField: RealmList = realmListOf() var doubleListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() - var objectIdListField: RealmList = realmListOf() var bsonObjectIdListField: RealmList = realmListOf() var uuidListField: RealmList = realmListOf() var binaryListField: RealmList = realmListOf() @@ -106,7 +104,6 @@ class Sample : RealmObject { var nullableFloatListField: RealmList = realmListOf() var nullableDoubleListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() - var nullableObjectIdListField: RealmList = realmListOf() var nullableBsonObjectIdListField: RealmList = realmListOf() var nullableUUIDListField: RealmList = realmListOf() var nullableBinaryListField: RealmList = realmListOf() @@ -124,7 +121,6 @@ class Sample : RealmObject { var floatSetField: RealmSet = realmSetOf() var doubleSetField: RealmSet = realmSetOf() var timestampSetField: RealmSet = realmSetOf() - var objectIdSetField: RealmSet = realmSetOf() var bsonObjectIdSetField: RealmSet = realmSetOf() var uuidSetField: RealmSet = realmSetOf() var binarySetField: RealmSet = realmSetOf() @@ -142,7 +138,6 @@ class Sample : RealmObject { var nullableFloatSetField: RealmSet = realmSetOf() var nullableDoubleSetField: RealmSet = realmSetOf() var nullableTimestampSetField: RealmSet = realmSetOf() - var nullableObjectIdSetField: RealmSet = realmSetOf() var nullableBsonObjectIdSetField: RealmSet = realmSetOf() var nullableUUIDSetField: RealmSet = realmSetOf() var nullableBinarySetField: RealmSet = realmSetOf() @@ -161,7 +156,6 @@ class Sample : RealmObject { var floatDictionaryField: RealmDictionary = realmDictionaryOf() var doubleDictionaryField: RealmDictionary = realmDictionaryOf() var timestampDictionaryField: RealmDictionary = realmDictionaryOf() - var objectIdDictionaryField: RealmDictionary = realmDictionaryOf() var bsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var uuidDictionaryField: RealmDictionary = realmDictionaryOf() var binaryDictionaryField: RealmDictionary = realmDictionaryOf() @@ -178,7 +172,6 @@ class Sample : RealmObject { var nullableFloatDictionaryField: RealmDictionary = realmDictionaryOf() var nullableDoubleDictionaryField: RealmDictionary = realmDictionaryOf() var nullableTimestampDictionaryField: RealmDictionary = realmDictionaryOf() - var nullableObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableUUIDDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBinaryDictionaryField: RealmDictionary = realmDictionaryOf() diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt index 220d0c8ed8..7e0c954b55 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt @@ -17,7 +17,6 @@ package io.realm.kotlin.entities import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject @@ -40,7 +39,6 @@ class Nullability : RealmObject { var doubleField: Double? = null var decimal128Field: Decimal128? = null var timestampField: RealmInstant? = null - var objectIdField: ObjectId? = null var bsonObjectIdField: BsonObjectId? = null var uuidField: RealmUUID? = null var binaryField: ByteArray? = null diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt index d4617e5250..c77df7a104 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt @@ -22,7 +22,6 @@ import io.realm.kotlin.ext.realmDictionaryOf import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.ext.realmSetOf import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -47,7 +46,6 @@ class Sample : RealmObject { var doubleField: Double = 1.19840122 var decimal128Field: Decimal128 = Decimal128("1.8446744073709551618E-6157") var timestampField: RealmInstant = RealmInstant.from(100, 1000) - var objectIdField: ObjectId = ObjectId.from("507f1f77bcf86cd799439011") var bsonObjectIdField: BsonObjectId = BsonObjectId("507f1f77bcf86cd799439011") var uuidField: RealmUUID = RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76") var binaryField: ByteArray = byteArrayOf(42) @@ -64,8 +62,7 @@ class Sample : RealmObject { var nullableDoubleField: Double? = null var nullableDecimal128Field: Decimal128? = null var nullableTimestampField: RealmInstant? = null - var nullableObjectIdField: ObjectId? = null - var nullableBsonObjectIdField: ObjectId? = null + var nullableBsonObjectIdField: BsonObjectId? = null var nullableUUIDField: RealmUUID? = null var nullableBinaryField: ByteArray? = null var nullableMutableRealmIntField: MutableRealmInt? = null @@ -82,7 +79,6 @@ class Sample : RealmObject { var floatListField: RealmList = realmListOf() var doubleListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() - var objectIdListField: RealmList = realmListOf() var bsonObjectIdListField: RealmList = realmListOf() var uuidListField: RealmList = realmListOf() var binaryListField: RealmList = realmListOf() @@ -99,7 +95,6 @@ class Sample : RealmObject { var nullableFloatListField: RealmList = realmListOf() var nullableDoubleListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() - var nullableObjectIdListField: RealmList = realmListOf() var nullableBsonObjectIdListField: RealmList = realmListOf() var nullableUUIDListField: RealmList = realmListOf() var nullableBinaryListField: RealmList = realmListOf() @@ -116,7 +111,6 @@ class Sample : RealmObject { var floatSetField: RealmSet = realmSetOf() var doubleSetField: RealmSet = realmSetOf() var timestampSetField: RealmSet = realmSetOf() - var objectIdSetField: RealmSet = realmSetOf() var bsonObjectIdSetField: RealmSet = realmSetOf() var uuidSetField: RealmSet = realmSetOf() var binarySetField: RealmSet = realmSetOf() @@ -133,7 +127,6 @@ class Sample : RealmObject { var nullableFloatSetField: RealmSet = realmSetOf() var nullableDoubleSetField: RealmSet = realmSetOf() var nullableTimestampSetField: RealmSet = realmSetOf() - var nullableObjectIdSetField: RealmSet = realmSetOf() var nullableBsonObjectIdSetField: RealmSet = realmSetOf() var nullableUUIDSetField: RealmSet = realmSetOf() var nullableBinarySetField: RealmSet = realmSetOf() @@ -150,7 +143,6 @@ class Sample : RealmObject { var floatDictionaryField: RealmDictionary = realmDictionaryOf() var doubleDictionaryField: RealmDictionary = realmDictionaryOf() var timestampDictionaryField: RealmDictionary = realmDictionaryOf() - var objectIdDictionaryField: RealmDictionary = realmDictionaryOf() var bsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var uuidDictionaryField: RealmDictionary = realmDictionaryOf() var binaryDictionaryField: RealmDictionary = realmDictionaryOf() @@ -166,7 +158,6 @@ class Sample : RealmObject { var nullableFloatDictionaryField: RealmDictionary = realmDictionaryOf() var nullableDoubleDictionaryField: RealmDictionary = realmDictionaryOf() var nullableTimestampDictionaryField: RealmDictionary = realmDictionaryOf() - var nullableObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableUUIDDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBinaryDictionaryField: RealmDictionary = realmDictionaryOf() diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/SampleWithPrimaryKey.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/SampleWithPrimaryKey.kt index 5368e95c26..e3f516d887 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/SampleWithPrimaryKey.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/SampleWithPrimaryKey.kt @@ -19,7 +19,6 @@ package io.realm.kotlin.entities import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.ext.realmSetOf -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject @@ -68,7 +67,6 @@ class SampleWithPrimaryKey : RealmObject { var floatListField: RealmList = realmListOf() var doubleListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() - var objectIdListField: RealmList = realmListOf() var bsonObjectIdListField: RealmList = realmListOf() var binaryListField: RealmList = realmListOf() var objectListField: RealmList = realmListOf() @@ -83,7 +81,6 @@ class SampleWithPrimaryKey : RealmObject { var nullableFloatListField: RealmList = realmListOf() var nullableDoubleListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() - var nullableObjectIdListField: RealmList = realmListOf() var nullableBsonObjectIdListField: RealmList = realmListOf() var nullableBinaryListField: RealmList = realmListOf() @@ -97,7 +94,6 @@ class SampleWithPrimaryKey : RealmObject { var floatSetField: RealmSet = realmSetOf() var doubleSetField: RealmSet = realmSetOf() var timestampSetField: RealmSet = realmSetOf() - var objectIdSetField: RealmSet = realmSetOf() var bsonObjectIdSetField: RealmSet = realmSetOf() var binarySetField: RealmSet = realmSetOf() var objectSetField: RealmSet = realmSetOf() @@ -112,7 +108,6 @@ class SampleWithPrimaryKey : RealmObject { var nullableFloatSetField: RealmSet = realmSetOf() var nullableDoubleSetField: RealmSet = realmSetOf() var nullableTimestampSetField: RealmSet = realmSetOf() - var nullableObjectIdSetField: RealmSet = realmSetOf() var nullableBsonObjectIdSetField: RealmSet = realmSetOf() var nullableBinarySetField: RealmSet = realmSetOf() diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/dictionary/RealmDictionaryContainer.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/dictionary/RealmDictionaryContainer.kt index 2ec62e7d0b..294d589d7e 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/dictionary/RealmDictionaryContainer.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/dictionary/RealmDictionaryContainer.kt @@ -18,7 +18,6 @@ package io.realm.kotlin.entities.dictionary import io.realm.kotlin.ext.realmDictionaryOf import io.realm.kotlin.types.EmbeddedRealmObject -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -43,7 +42,6 @@ class RealmDictionaryContainer : RealmObject { var floatDictionaryField: RealmDictionary = realmDictionaryOf() var doubleDictionaryField: RealmDictionary = realmDictionaryOf() var timestampDictionaryField: RealmDictionary = realmDictionaryOf() - var objectIdDictionaryField: RealmDictionary = realmDictionaryOf() var bsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var uuidDictionaryField: RealmDictionary = realmDictionaryOf() var binaryDictionaryField: RealmDictionary = realmDictionaryOf() @@ -59,7 +57,6 @@ class RealmDictionaryContainer : RealmObject { var nullableFloatDictionaryField: RealmDictionary = realmDictionaryOf() var nullableDoubleDictionaryField: RealmDictionary = realmDictionaryOf() var nullableTimestampDictionaryField: RealmDictionary = realmDictionaryOf() - var nullableObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableUUIDDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBinaryDictionaryField: RealmDictionary = realmDictionaryOf() @@ -81,7 +78,6 @@ class RealmDictionaryContainer : RealmObject { Float::class to RealmDictionaryContainer::floatDictionaryField as KMutableProperty1>, Double::class to RealmDictionaryContainer::doubleDictionaryField as KMutableProperty1>, RealmInstant::class to RealmDictionaryContainer::timestampDictionaryField as KMutableProperty1>, - ObjectId::class to RealmDictionaryContainer::objectIdDictionaryField as KMutableProperty1>, BsonObjectId::class to RealmDictionaryContainer::bsonObjectIdDictionaryField as KMutableProperty1>, RealmUUID::class to RealmDictionaryContainer::uuidDictionaryField as KMutableProperty1>, ByteArray::class to RealmDictionaryContainer::binaryDictionaryField as KMutableProperty1>, @@ -100,7 +96,6 @@ class RealmDictionaryContainer : RealmObject { Float::class to RealmDictionaryContainer::nullableFloatDictionaryField as KMutableProperty1>, Double::class to RealmDictionaryContainer::nullableDoubleDictionaryField as KMutableProperty1>, RealmInstant::class to RealmDictionaryContainer::nullableTimestampDictionaryField as KMutableProperty1>, - ObjectId::class to RealmDictionaryContainer::nullableObjectIdDictionaryField as KMutableProperty1>, BsonObjectId::class to RealmDictionaryContainer::nullableBsonObjectIdDictionaryField as KMutableProperty1>, RealmUUID::class to RealmDictionaryContainer::nullableUUIDDictionaryField as KMutableProperty1>, ByteArray::class to RealmDictionaryContainer::nullableBinaryDictionaryField as KMutableProperty1>, diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt index e4b1b0f2fd..7853622744 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt @@ -18,7 +18,6 @@ package io.realm.kotlin.entities.list import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.types.EmbeddedRealmObject -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList @@ -46,7 +45,6 @@ class RealmListContainer : RealmObject { var doubleListField: RealmList = realmListOf() var decimal128ListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() - var objectIdListField: RealmList = realmListOf() var bsonObjectIdListField: RealmList = realmListOf() var uuidListField: RealmList = realmListOf() var binaryListField: RealmList = realmListOf() @@ -64,7 +62,6 @@ class RealmListContainer : RealmObject { var nullableDoubleListField: RealmList = realmListOf() var nullableDecimal128Field: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() - var nullableObjectIdListField: RealmList = realmListOf() var nullableBsonObjectIdListField: RealmList = realmListOf() var nullableUUIDListField: RealmList = realmListOf() var nullableBinaryListField: RealmList = realmListOf() @@ -85,7 +82,6 @@ class RealmListContainer : RealmObject { Double::class to RealmListContainer::doubleListField as KMutableProperty1>, Decimal128::class to RealmListContainer::decimal128ListField as KMutableProperty1>, RealmInstant::class to RealmListContainer::timestampListField as KMutableProperty1>, - ObjectId::class to RealmListContainer::objectIdListField as KMutableProperty1>, BsonObjectId::class to RealmListContainer::bsonObjectIdListField as KMutableProperty1>, RealmUUID::class to RealmListContainer::uuidListField as KMutableProperty1>, ByteArray::class to RealmListContainer::binaryListField as KMutableProperty1>, @@ -105,7 +101,6 @@ class RealmListContainer : RealmObject { Double::class to RealmListContainer::nullableDoubleListField as KMutableProperty1>, Decimal128::class to RealmListContainer::nullableDecimal128Field as KMutableProperty1>, RealmInstant::class to RealmListContainer::nullableTimestampListField as KMutableProperty1>, - ObjectId::class to RealmListContainer::nullableObjectIdListField as KMutableProperty1>, BsonObjectId::class to RealmListContainer::nullableBsonObjectIdListField as KMutableProperty1>, RealmUUID::class to RealmListContainer::nullableUUIDListField as KMutableProperty1>, ByteArray::class to RealmListContainer::nullableBinaryListField as KMutableProperty1>, diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt index eeb872bcd7..f1aa4df3f4 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt @@ -16,7 +16,6 @@ package io.realm.kotlin.entities.primarykey -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.types.annotations.PrimaryKey @@ -87,16 +86,6 @@ class PrimaryKeyStringNullable : RealmObject { var primaryKey: String? = Random.nextULong().toString() } -class PrimaryKeyObjectId : RealmObject { - @PrimaryKey - var primaryKey: ObjectId = ObjectId.create() -} - -class PrimaryKeyObjectIdNullable : RealmObject { - @PrimaryKey - var primaryKey: ObjectId? = ObjectId.from("507f191e810c19729de860ea") -} - class PrimaryKeyBsonObjectId : RealmObject { @PrimaryKey var primaryKey: BsonObjectId = BsonObjectId() diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt index ef4a5aad2a..ea22ba6d8a 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt @@ -20,7 +20,6 @@ import io.realm.kotlin.entities.Sample import io.realm.kotlin.ext.realmDictionaryOf import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.ext.realmSetOf -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -55,7 +54,6 @@ class SchemaVariations : RealmObject { @FullText var fulltext: String = "A very long string" var date: RealmInstant = RealmInstant.from(0, 0) - var objectId: ObjectId = ObjectId.create() var bsonObjectId: BsonObjectId = BsonObjectId() var decimal128: Decimal128 = Decimal128("1") var uuid: RealmUUID = RealmUUID.random() @@ -78,7 +76,6 @@ class SchemaVariations : RealmObject { var decimal128List: RealmList = realmListOf() var stringList: RealmList = realmListOf() var dateList: RealmList = realmListOf() - var objectIdList: RealmList = realmListOf() var bsonObjectIdList: RealmList = realmListOf() var uuidList: RealmList = realmListOf() var binaryList: RealmList = realmListOf() @@ -100,7 +97,6 @@ class SchemaVariations : RealmObject { var decimal128Set: RealmSet = realmSetOf() var stringSet: RealmSet = realmSetOf() var dateSet: RealmSet = realmSetOf() - var objectIdSet: RealmSet = realmSetOf() var bsonObjectIdSet: RealmSet = realmSetOf() var uuidSet: RealmSet = realmSetOf() var binarySet: RealmSet = realmSetOf() @@ -122,7 +118,6 @@ class SchemaVariations : RealmObject { var decimal128Map: RealmDictionary = realmDictionaryOf() var stringMap: RealmDictionary = realmDictionaryOf() var dateMap: RealmDictionary = realmDictionaryOf() - var objectIdMap: RealmDictionary = realmDictionaryOf() var bsonObjectIdMap: RealmDictionary = realmDictionaryOf() var uuidMap: RealmDictionary = realmDictionaryOf() var binaryMap: RealmDictionary = realmDictionaryOf() diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/set/RealmSetContainer.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/set/RealmSetContainer.kt index 91d2130cca..c439b21dbd 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/set/RealmSetContainer.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/set/RealmSetContainer.kt @@ -17,7 +17,6 @@ package io.realm.kotlin.entities.set import io.realm.kotlin.ext.realmSetOf -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject @@ -43,7 +42,6 @@ class RealmSetContainer : RealmObject { var doubleSetField: RealmSet = realmSetOf() var decimal128SetField: RealmSet = realmSetOf() var timestampSetField: RealmSet = realmSetOf() - var objectIdSetField: RealmSet = realmSetOf() var bsonObjectIdSetField: RealmSet = realmSetOf() var uuidSetField: RealmSet = realmSetOf() var binarySetField: RealmSet = realmSetOf() @@ -60,7 +58,6 @@ class RealmSetContainer : RealmObject { var nullableDoubleSetField: RealmSet = realmSetOf() var nullableDecimal128SetField: RealmSet = realmSetOf() var nullableTimestampSetField: RealmSet = realmSetOf() - var nullableObjectIdSetField: RealmSet = realmSetOf() var nullableBsonObjectIdSetField: RealmSet = realmSetOf() var nullableUUIDSetField: RealmSet = realmSetOf() var nullableBinarySetField: RealmSet = realmSetOf() @@ -80,7 +77,6 @@ class RealmSetContainer : RealmObject { Double::class to RealmSetContainer::doubleSetField as KMutableProperty1>, Decimal128::class to RealmSetContainer::decimal128SetField as KMutableProperty1>, RealmInstant::class to RealmSetContainer::timestampSetField as KMutableProperty1>, - ObjectId::class to RealmSetContainer::objectIdSetField as KMutableProperty1>, BsonObjectId::class to RealmSetContainer::bsonObjectIdSetField as KMutableProperty1>, RealmUUID::class to RealmSetContainer::uuidSetField as KMutableProperty1>, ByteArray::class to RealmSetContainer::binarySetField as KMutableProperty1>, @@ -100,7 +96,6 @@ class RealmSetContainer : RealmObject { Double::class to RealmSetContainer::nullableDoubleSetField as KMutableProperty1>, Decimal128::class to RealmSetContainer::nullableDecimal128SetField as KMutableProperty1>, RealmInstant::class to RealmSetContainer::nullableTimestampSetField as KMutableProperty1>, - ObjectId::class to RealmSetContainer::nullableObjectIdSetField as KMutableProperty1>, BsonObjectId::class to RealmSetContainer::nullableBsonObjectIdSetField as KMutableProperty1>, RealmUUID::class to RealmSetContainer::nullableUUIDSetField as KMutableProperty1>, ByteArray::class to RealmSetContainer::nullableBinarySetField as KMutableProperty1>, diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt index e580576cfd..d31a095106 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt @@ -19,7 +19,6 @@ import io.realm.kotlin.internal.interop.CollectionType import io.realm.kotlin.internal.interop.PropertyType import io.realm.kotlin.internal.platform.returnType import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject @@ -286,7 +285,6 @@ object TypeDescriptor { Boolean::class to CoreFieldType.BOOL, String::class to CoreFieldType.STRING, RealmInstant::class to CoreFieldType.TIMESTAMP, - ObjectId::class to CoreFieldType.OBJECT_ID, BsonObjectId::class to CoreFieldType.OBJECT_ID, RealmUUID::class to CoreFieldType.UUID, ByteArray::class to CoreFieldType.BINARY, @@ -297,7 +295,7 @@ object TypeDescriptor { // The deprecated variant of ObjectId is not allowed as it was already deprecated when RealmAny // was added val anyClassifiers = - classifiers.filter { it.value.anySupport && it.key != ObjectId::class } + classifiers.filter { it.value.anySupport } // Element type is the type of the element of either a singular field or the container element type. // Basically just a clone of KType but with the ability to create them from input parameters at diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/BsonObjectIdTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/BsonObjectIdTests.kt index 48c622e8ef..216678fe55 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/BsonObjectIdTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/BsonObjectIdTests.kt @@ -26,7 +26,7 @@ import io.realm.kotlin.query.find import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.use import io.realm.kotlin.types.RealmInstant -import kotlinx.coroutines.delay +import kotlinx.datetime.Clock import org.mongodb.kbson.ObjectId import kotlin.test.AfterTest import kotlin.test.BeforeTest @@ -128,12 +128,10 @@ class BsonObjectIdTests { @Test fun queries() = runBlocking { - val objectId1 = ObjectId() - delay(100) - val objectId2 = ObjectId() - delay(100) - val objectId3 = ObjectId() - delay(100) + val timestamp = Clock.System.now().toEpochMilliseconds() + val objectId1 = ObjectId(timestamp) + val objectId2 = ObjectId(timestamp + 100) + val objectId3 = ObjectId(timestamp + 200) val config = RealmConfiguration.Builder(setOf(Sample::class)) .directory(tmpDir) @@ -159,7 +157,7 @@ class BsonObjectIdTests { } val ids: RealmResults = - realm.query().sort("objectIdField", Sort.ASCENDING).find() + realm.query().sort("bsonObjectIdField", Sort.ASCENDING).find() assertEquals(3, ids.size) assertEquals("obj1", ids[0].stringField) diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/CopyFromRealmTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/CopyFromRealmTests.kt index 73064a7c04..6803f9e7a5 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/CopyFromRealmTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/CopyFromRealmTests.kt @@ -46,7 +46,6 @@ import io.realm.kotlin.schema.ValuePropertyType import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.types.BaseRealmObject import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -932,7 +931,6 @@ class CopyFromRealmTests { Double::class -> 1.234 ByteArray::class -> byteArrayOf(43) RealmInstant::class -> RealmInstant.from(1, 100) - ObjectId::class -> ObjectId.from("635a1a95184a200db8a07bfc") RealmUUID::class -> RealmUUID.from("defda04c-80ac-4ed9-86f5-334fef3dcf8a") MutableRealmInt::class -> MutableRealmInt.create(7) RealmAny::class -> RealmAny.create(1) @@ -964,7 +962,6 @@ class CopyFromRealmTests { Double::class -> realmListOf(1.234, 1.345) ByteArray::class -> realmListOf(byteArrayOf(42), byteArrayOf(43)) RealmInstant::class -> realmListOf(RealmInstant.from(1, 0), RealmInstant.from(1, 1)) - ObjectId::class -> realmListOf(ObjectId.from("635a1a95184a200db8a07bfc"), ObjectId.from("735a1a95184a200db8a07bfc")) RealmUUID::class -> realmListOf(RealmUUID.from("defda04c-80ac-4ed9-86f5-334fef3dcf8a"), RealmUUID.from("eefda04c-80ac-4ed9-86f5-334fef3dcf8a")) BsonObjectId::class -> realmListOf(BsonObjectId("635a1a95184a200db8a07bfc"), BsonObjectId("735a1a95184a200db8a07bfc")) Decimal128::class -> realmListOf(Decimal128("1.8446744073709551618E-615"), Decimal128("2.8446744073709551618E-6151")) @@ -997,7 +994,6 @@ class CopyFromRealmTests { Double::class -> realmSetOf(1.234, 1.345) ByteArray::class -> realmSetOf(byteArrayOf(42), byteArrayOf(43)) RealmInstant::class -> realmSetOf(RealmInstant.from(1, 0), RealmInstant.from(1, 1)) - ObjectId::class -> realmSetOf(ObjectId.from("635a1a95184a200db8a07bfc"), ObjectId.from("735a1a95184a200db8a07bfc")) RealmUUID::class -> realmSetOf(RealmUUID.from("defda04c-80ac-4ed9-86f5-334fef3dcf8a"), RealmUUID.from("eefda04c-80ac-4ed9-86f5-334fef3dcf8a")) BsonObjectId::class -> realmSetOf(BsonObjectId("635a1a95184a200db8a07bfc"), BsonObjectId("735a1a95184a200db8a07bfc")) Decimal128::class -> realmSetOf(Decimal128("1.8446744073709551618E-615"), Decimal128("2.8446744073709551618E-6151")) @@ -1032,7 +1028,6 @@ class CopyFromRealmTests { Double::class -> realmDictionaryOf("A" to 1.234, "B" to 1.345) ByteArray::class -> realmDictionaryOf("A" to byteArrayOf(42), "B" to byteArrayOf(43)) RealmInstant::class -> realmDictionaryOf("A" to RealmInstant.from(1, 0), "B" to RealmInstant.from(1, 1)) - ObjectId::class -> realmDictionaryOf("A" to ObjectId.from("635a1a95184a200db8a07bfc"), "B" to ObjectId.from("735a1a95184a200db8a07bfc")) RealmUUID::class -> realmDictionaryOf("A" to RealmUUID.from("defda04c-80ac-4ed9-86f5-334fef3dcf8a"), "B" to RealmUUID.from("eefda04c-80ac-4ed9-86f5-334fef3dcf8a")) BsonObjectId::class -> realmDictionaryOf("A" to BsonObjectId("635a1a95184a200db8a07bfc"), "B" to BsonObjectId("735a1a95184a200db8a07bfc")) Decimal128::class -> realmDictionaryOf("A" to Decimal128("1.8446744073709551618E-615"), "B" to Decimal128("2.8446744073709551618E-6151")) diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ImportTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ImportTests.kt index 1e8e79bf77..d840e26dd4 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ImportTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ImportTests.kt @@ -27,7 +27,6 @@ import io.realm.kotlin.test.common.utils.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor.classifiers import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject @@ -92,7 +91,6 @@ class ImportTests { Double::class -> assertEquals(1.19840122, managed.doubleField) Decimal128::class -> assertEquals(Decimal128("1.8446744073709551618E-6157"), managed.decimal128Field) RealmInstant::class -> assertEquals(RealmInstant.from(100, 1000), managed.timestampField) - ObjectId::class -> assertEquals(ObjectId.from("507f1f77bcf86cd799439011"), managed.objectIdField) BsonObjectId::class -> assertEquals(BsonObjectId("507f1f77bcf86cd799439011"), managed.bsonObjectIdField) RealmUUID::class -> assertEquals(RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76"), managed.uuidField) RealmObject::class -> assertEquals(null, managed.nullableObject) diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/NullabilityTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/NullabilityTests.kt index 5917acd8bf..bd9b32d6f1 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/NullabilityTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/NullabilityTests.kt @@ -22,7 +22,6 @@ import io.realm.kotlin.ext.query import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmUUID @@ -122,7 +121,6 @@ class NullabilityTests { testProperty(Nullability::decimal128Field, Decimal128("123.456")) testProperty(Nullability::objectField, null) testProperty(Nullability::timestampField, RealmInstant.from(42, 420)) - testProperty(Nullability::objectIdField, ObjectId.from("507f191e810c19729de860ea")) testProperty(Nullability::bsonObjectIdField, BsonObjectId("507f191e810c19729de860ea")) testProperty(Nullability::uuidField, RealmUUID.random()) testProperty(Nullability::binaryField, byteArrayOf(42)) diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ObjectIdTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ObjectIdTests.kt deleted file mode 100644 index 68ef49a119..0000000000 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/ObjectIdTests.kt +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright 2022 Realm Inc. - * - * 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. - */ -package io.realm.kotlin.test.common - -import io.realm.kotlin.Realm -import io.realm.kotlin.RealmConfiguration -import io.realm.kotlin.entities.Sample -import io.realm.kotlin.ext.query -import io.realm.kotlin.internal.platform.runBlocking -import io.realm.kotlin.query.RealmResults -import io.realm.kotlin.query.Sort -import io.realm.kotlin.query.find -import io.realm.kotlin.test.common.utils.assertFailsWithMessage -import io.realm.kotlin.test.platform.PlatformUtils -import io.realm.kotlin.test.util.use -import io.realm.kotlin.types.ObjectId -import io.realm.kotlin.types.RealmInstant -import kotlinx.coroutines.delay -import kotlin.test.AfterTest -import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertNotEquals -import kotlin.test.assertNotNull -import kotlin.test.assertTrue - -class ObjectIdTests { - - private lateinit var tmpDir: String - private lateinit var realm: Realm - - @BeforeTest - fun setup() { - tmpDir = PlatformUtils.createTempDir() - val configuration = RealmConfiguration.Builder(schema = setOf(Sample::class)) - .directory(tmpDir) - .build() - realm = Realm.open(configuration) - } - - @AfterTest - fun tearDown() { - if (this::realm.isInitialized && !realm.isClosed()) { - realm.close() - } - PlatformUtils.deleteTempDir(tmpDir) - } - - @Test - fun invalid_arguments() { - assertFailsWithMessage("invalid hexadecimal representation of an ObjectId: []") { - ObjectId.from("") // empty string - } - - assertFailsWithMessage("invalid hexadecimal representation of an ObjectId: [garbage]") { - ObjectId.from("garbage") // 12 char needed - } - - assertFailsWithMessage("invalid hexadecimal representation of an ObjectId: [56X1fc72e0c917e9c4714161]") { - ObjectId.from("56X1fc72e0c917e9c4714161") // invalid hex value - } - - assertFailsWithMessage("byte array size must be 12") { - ObjectId.from(byteArrayOf(0xCA.toByte(), 0xFE.toByte(), 0xBA.toByte(), 0xBE.toByte())) - } - } - - @Test - fun boundaries() { - roundTrip(ObjectId.from("000000000000000000000000")) { value -> - assertEquals(ObjectId.from("000000000000000000000000"), value) - } - - val min = ObjectId.from(RealmInstant.MIN) - roundTrip(min) { value -> - assertEquals(min, value) - } - - roundTrip(ObjectId.from("ffffffffffffffffffffffff")) { value -> - assertEquals(ObjectId.from("ffffffffffffffffffffffff"), value) - } - - val max = ObjectId.from(RealmInstant.MAX) - roundTrip(max) { value -> - assertEquals(max, value) - } - - roundTrip(ObjectId.from("56e1fc72e0c917e9c4714161")) { value -> - assertEquals(ObjectId.from("56e1fc72e0c917e9c4714161"), value) - } - - val fromDate = ObjectId.from(RealmInstant.from(42, 42)) - roundTrip(fromDate) { value -> - assertEquals(fromDate, value) - } - - val bytes = byteArrayOf( - 0x56.toByte(), - 0xe1.toByte(), - 0xfc.toByte(), - 0x72.toByte(), - 0xe0.toByte(), - 0xc9.toByte(), - 0x17.toByte(), - 0xe9.toByte(), - 0xc4.toByte(), - 0x71.toByte(), - 0x41.toByte(), - 0x61.toByte() - ) - roundTrip(ObjectId.from(bytes)) { value -> - assertEquals(ObjectId.from(bytes), value) - } - } - - // Store value and retrieve it again - private fun roundTrip(objectId: ObjectId, function: (ObjectId) -> Unit) { - // Test managed objects - realm.writeBlocking { - copyToRealm( - Sample().apply { - objectIdField = objectId - } - ) - val managedObjectId = query() - .first() - .find { sampleObject -> - assertNotNull(sampleObject) - sampleObject.objectIdField - } - function(managedObjectId) - cancelWrite() // So we can use .first() - } - } - - @Test - fun equals() { - assertEquals(ObjectId.from("56e1fc72e0c917e9c4714161"), ObjectId.from("56E1FC72E0C917E9C4714161")) - val bytes = byteArrayOf( - 0x56.toByte(), - 0xe1.toByte(), - 0xfc.toByte(), - 0x72.toByte(), - 0xe0.toByte(), - 0xc9.toByte(), - 0x17.toByte(), - 0xe9.toByte(), - 0xc4.toByte(), - 0x71.toByte(), - 0x41.toByte(), - 0x61.toByte() - ) - assertEquals(ObjectId.from(bytes), ObjectId.from(bytes)) - - assertNotEquals(ObjectId.from(bytes), ObjectId.from("6281720cd500030571452df6")) - assertNotEquals(ObjectId.create(), ObjectId.from("6281720cd500030571452df6")) - } - - @Test - fun to_String() { - assertEquals( - "56e1fc72e0c917e9c4714161", - ObjectId.from("56E1FC72E0C917E9C4714161").toString() - ) - } - - @Test - fun compare() { - val oid1 = ObjectId.from(RealmInstant.from(1, 0)) - val oid2 = ObjectId.from(RealmInstant.from(2, 0)) - val oid3 = ObjectId.from(RealmInstant.from(0, 0)) - val oid4 = ObjectId.from(RealmInstant.from(3, 0)) - val oid5 = ObjectId.from(RealmInstant.from(-1, 0)) - - assertTrue(oid1.compareTo(oid2) < 0) - assertTrue(oid1.compareTo(oid1) == 0) - assertTrue(oid1.compareTo(oid3) > 0) - assertTrue(oid1.compareTo(oid4) < 0) - assertTrue(oid1.compareTo(oid5) > 0) - } - - @Test - fun queries() = runBlocking { - val objectId1 = ObjectId.create() - delay(100) - val objectId2 = ObjectId.create() - delay(100) - val objectId3 = ObjectId.create() - delay(100) - - val config = RealmConfiguration.Builder(setOf(Sample::class)) - .directory(tmpDir) - .build() - Realm.open(config).use { realm -> - val objWithPK1 = Sample().apply { - stringField = "obj1" - objectIdField = objectId1 - } - val objWithPK2 = Sample().apply { - stringField = "obj2" - objectIdField = objectId2 - } - val objWithPK3 = Sample().apply { - stringField = "obj3" - objectIdField = objectId3 - } - - realm.writeBlocking { - copyToRealm(objWithPK1) - copyToRealm(objWithPK2) - copyToRealm(objWithPK3) - } - - val ids: RealmResults = - realm.query().sort("objectIdField", Sort.ASCENDING).find() - assertEquals(3, ids.size) - - assertEquals("obj1", ids[0].stringField) - assertEquals(objectId1, ids[0].objectIdField) - - assertEquals("obj2", ids[1].stringField) - assertEquals(objectId2, ids[1].objectIdField) - - assertEquals("obj3", ids[2].stringField) - assertEquals(objectId3, ids[2].objectIdField) - } - } -} diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PersistedNameTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PersistedNameTests.kt index e5af30b72d..e8c9fbe96d 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PersistedNameTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PersistedNameTests.kt @@ -34,7 +34,6 @@ import io.realm.kotlin.schema.RealmStorageType import io.realm.kotlin.test.common.utils.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.use -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject @@ -54,7 +53,6 @@ import kotlin.test.assertTrue import kotlin.test.fail private val bsonObjectId = BsonObjectId("507f191e810c19729de860ea") -private val objectId = ObjectId.from("507f191e810c19729de860ea") class PersistedNameTests { @@ -143,12 +141,6 @@ class PersistedNameTests { value = "Realm" ) - assertCanQuerySingle( - property = PersistedNameSample::publicNameObjectIdField, - nameToQueryBy = "persistedNameObjectIdField", - value = objectId - ) - assertCanQuerySingle( property = PersistedNameSample::publicNameBsonObjectIdField, nameToQueryBy = "persistedNameBsonObjectIdField", @@ -168,12 +160,6 @@ class PersistedNameTests { value = "Realm" ) - assertCanQuerySingle( - property = PersistedNameSample::publicNameObjectIdField, - nameToQueryBy = "publicNameObjectIdField", - value = objectId - ) - assertCanQuerySingle( property = PersistedNameSample::publicNameBsonObjectIdField, nameToQueryBy = "publicNameBsonObjectIdField", @@ -502,9 +488,6 @@ class PersistedNameSample : RealmObject { @PersistedName("persistedNameTimestampField") var publicNameTimestampField: RealmInstant = RealmInstant.from(100, 1000) - @PersistedName("persistedNameObjectIdField") - var publicNameObjectIdField: ObjectId = objectId - @PersistedName("persistedNameBsonObjectIdField") var publicNameBsonObjectIdField: BsonObjectId = bsonObjectId diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PrimaryKeyTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PrimaryKeyTests.kt index 4cea0deae7..ce1cd622a0 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PrimaryKeyTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/PrimaryKeyTests.kt @@ -28,8 +28,6 @@ import io.realm.kotlin.entities.primarykey.PrimaryKeyInt import io.realm.kotlin.entities.primarykey.PrimaryKeyIntNullable import io.realm.kotlin.entities.primarykey.PrimaryKeyLong import io.realm.kotlin.entities.primarykey.PrimaryKeyLongNullable -import io.realm.kotlin.entities.primarykey.PrimaryKeyObjectId -import io.realm.kotlin.entities.primarykey.PrimaryKeyObjectIdNullable import io.realm.kotlin.entities.primarykey.PrimaryKeyRealmUUID import io.realm.kotlin.entities.primarykey.PrimaryKeyRealmUUIDNullable import io.realm.kotlin.entities.primarykey.PrimaryKeyShort @@ -43,7 +41,6 @@ import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor.allPrimaryKeyFieldTypes import io.realm.kotlin.test.util.TypeDescriptor.rType import io.realm.kotlin.test.util.use -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.RealmUUID import org.mongodb.kbson.BsonObjectId @@ -173,8 +170,6 @@ class PrimaryKeyTests { typeOf(), typeOf(), typeOf(), - typeOf(), - typeOf(), typeOf(), typeOf(), typeOf(), @@ -206,8 +201,6 @@ class PrimaryKeyTests { PrimaryKeyStringNullable::class, PrimaryKeyBsonObjectId::class, PrimaryKeyBsonObjectIdNullable::class, - PrimaryKeyObjectId::class, - PrimaryKeyObjectIdNullable::class, PrimaryKeyRealmUUID::class, PrimaryKeyRealmUUIDNullable::class, ) @@ -228,8 +221,6 @@ class PrimaryKeyTests { PrimaryKeyStringNullable::class, PrimaryKeyBsonObjectId::class, PrimaryKeyBsonObjectIdNullable::class, - PrimaryKeyObjectId::class, - PrimaryKeyObjectIdNullable::class, PrimaryKeyRealmUUID::class, PrimaryKeyRealmUUIDNullable::class, ) diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/QueryTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/QueryTests.kt index 0b6eb5dc3c..c9bd4a159d 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/QueryTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/QueryTests.kt @@ -24,7 +24,6 @@ import io.realm.kotlin.ext.query import io.realm.kotlin.ext.realmDictionaryOf import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.ext.realmSetOf -import io.realm.kotlin.internal.ObjectIdImpl import io.realm.kotlin.internal.platform.singleThreadDispatcher import io.realm.kotlin.internal.query.AggregatorQueryType import io.realm.kotlin.notifications.DeletedObject @@ -48,7 +47,6 @@ import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TestChannel import io.realm.kotlin.test.util.TypeDescriptor import io.realm.kotlin.test.util.receiveOrFail -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -145,7 +143,6 @@ class QueryTests { doubleField = 1.0 decimal128Field = Decimal128("2.8446744073709551618E-6151") timestampField = RealmInstant.from(100, 1001) - objectIdField = ObjectId.from("507f191e810c19729de860eb") bsonObjectIdField = BsonObjectId("507f191e810c19729de860eb") uuidField = RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d77") binaryField = byteArrayOf(43) @@ -202,34 +199,10 @@ class QueryTests { checkQuery(QuerySample::timestampField, RealmInstant.from(100, 1001)) } RealmStorageType.OBJECT_ID -> { - val realmObjectId = ObjectId.from("507f191e810c19729de860eb") val bsonObjectId = BsonObjectId("507f191e810c19729de860eb") // Check matching types first - checkQuery(QuerySample::objectIdField, realmObjectId) checkQuery(QuerySample::bsonObjectIdField, bsonObjectId) - - // Check against equivalent types now - do it manually since the convenience - // function forces the fields to have the same type as the query parameter - realm.query("bsonObjectIdField = $0", realmObjectId) - .find() - .single() - .run { - assertContentEquals( - (realmObjectId as ObjectIdImpl).bytes, - this.bsonObjectIdField.toByteArray() - ) - } - - realm.query("objectIdField = $0", bsonObjectId) - .find() - .single() - .run { - assertContentEquals( - bsonObjectId.toByteArray(), - (this.objectIdField as ObjectIdImpl).bytes - ) - } } RealmStorageType.UUID -> { checkQuery( @@ -2064,12 +2037,10 @@ class QueryTests { .forEach { aggregator -> listOf( QuerySample::booleanListField.name, - QuerySample::objectIdListField.name, QuerySample::bsonObjectIdListField.name, QuerySample::timestampListField.name, QuerySample::binaryListField.name, QuerySample::nullableBooleanListField.name, - QuerySample::nullableObjectIdListField.name, QuerySample::nullableBsonObjectIdListField.name, QuerySample::nullableTimestampListField.name, QuerySample::nullableBinaryListField.name, @@ -2131,12 +2102,10 @@ class QueryTests { .forEach { aggregator -> listOf( QuerySample::booleanSetField.name, - QuerySample::objectIdSetField.name, QuerySample::bsonObjectIdSetField.name, QuerySample::timestampSetField.name, QuerySample::binaryListField.name, QuerySample::nullableBooleanSetField.name, - QuerySample::nullableObjectIdSetField.name, QuerySample::nullableBsonObjectIdSetField.name, QuerySample::nullableTimestampSetField.name, QuerySample::nullableBinaryListField.name, @@ -2198,12 +2167,10 @@ class QueryTests { .forEach { aggregator -> listOf( QuerySample::booleanDictionaryField.name, - QuerySample::objectIdDictionaryField.name, QuerySample::bsonObjectIdDictionaryField.name, QuerySample::timestampDictionaryField.name, QuerySample::binaryListField.name, QuerySample::nullableBooleanDictionaryField.name, - QuerySample::nullableObjectIdDictionaryField.name, QuerySample::nullableBsonObjectIdDictionaryField.name, QuerySample::nullableTimestampDictionaryField.name, QuerySample::nullableBinaryListField.name, @@ -3338,7 +3305,6 @@ class QuerySample() : RealmObject { var doubleField: Double = 0.0 var decimal128Field: Decimal128 = Decimal128("1.84467440737095E-6157") var timestampField: RealmInstant = RealmInstant.from(100, 1000) - var objectIdField: ObjectId = ObjectId.from("507f191e810c19729de860ea") var bsonObjectIdField: BsonObjectId = BsonObjectId("507f191e810c19729de860ea") var uuidField: RealmUUID = RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76") var binaryField: ByteArray = byteArrayOf(42) @@ -3355,7 +3321,6 @@ class QuerySample() : RealmObject { var nullableDoubleField: Double? = null var nullableDecimal128Field: Decimal128? = null var nullableTimestampField: RealmInstant? = null - var nullableObjectIdField: ObjectId? = null var nullableBsonObjectIdField: BsonObjectId? = null var nullableBinaryField: ByteArray? = null var nullableRealmObject: QuerySample? = null @@ -3371,7 +3336,6 @@ class QuerySample() : RealmObject { var doubleListField: RealmList = realmListOf() var decimal128ListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() - var objectIdListField: RealmList = realmListOf() var bsonObjectIdListField: RealmList = realmListOf() var binaryListField: RealmList = realmListOf() var objectListField: RealmList = realmListOf() @@ -3387,7 +3351,6 @@ class QuerySample() : RealmObject { var nullableDoubleListField: RealmList = realmListOf() var nullableDecimal128ListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() - var nullableObjectIdListField: RealmList = realmListOf() var nullableBsonObjectIdListField: RealmList = realmListOf() var nullableBinaryListField: RealmList = realmListOf() @@ -3402,7 +3365,6 @@ class QuerySample() : RealmObject { var doubleSetField: RealmSet = realmSetOf() var decimal128SetField: RealmSet = realmSetOf() var timestampSetField: RealmSet = realmSetOf() - var objectIdSetField: RealmSet = realmSetOf() var bsonObjectIdSetField: RealmSet = realmSetOf() var binarySetField: RealmSet = realmSetOf() var objectSetField: RealmSet = realmSetOf() @@ -3418,7 +3380,6 @@ class QuerySample() : RealmObject { var nullableDoubleSetField: RealmSet = realmSetOf() var nullableDecimal128SetField: RealmSet = realmSetOf() var nullableTimestampSetField: RealmSet = realmSetOf() - var nullableObjectIdSetField: RealmSet = realmSetOf() var nullableBsonObjectIdSetField: RealmSet = realmSetOf() var nullableBinarySetField: RealmSet = realmSetOf() @@ -3433,7 +3394,6 @@ class QuerySample() : RealmObject { var doubleDictionaryField: RealmDictionary = realmDictionaryOf() var decimal128DictionaryField: RealmDictionary = realmDictionaryOf() var timestampDictionaryField: RealmDictionary = realmDictionaryOf() - var objectIdDictionaryField: RealmDictionary = realmDictionaryOf() var bsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var binaryDictionaryField: RealmDictionary = realmDictionaryOf() @@ -3448,7 +3408,6 @@ class QuerySample() : RealmObject { var nullableDoubleDictionaryField: RealmDictionary = realmDictionaryOf() var nullableDecimal128DictionaryField: RealmDictionary = realmDictionaryOf() var nullableTimestampDictionaryField: RealmDictionary = realmDictionaryOf() - var nullableObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBsonObjectIdDictionaryField: RealmDictionary = realmDictionaryOf() var nullableBinaryDictionaryField: RealmDictionary = realmDictionaryOf() var nullableObjectDictionaryField: RealmDictionary = realmDictionaryOf() diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmDictionaryTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmDictionaryTests.kt index 8507eb24d3..476616dc9f 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmDictionaryTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmDictionaryTests.kt @@ -34,7 +34,6 @@ import io.realm.kotlin.test.common.utils.GenericTypeSafetyManager import io.realm.kotlin.test.common.utils.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmDictionaryEntrySet @@ -1418,11 +1417,6 @@ fun getDataSetForDictionaryClassifier( } else { TIMESTAMP_VALUES.mapIndexed { i, value -> Pair(DICTIONARY_KEYS[i], value) } } - ObjectId::class -> if (nullable) { - NULLABLE_OBJECT_ID_VALUES.mapIndexed { i, value -> Pair(DICTIONARY_KEYS_FOR_NULLABLE[i], value) } - } else { - OBJECT_ID_VALUES.mapIndexed { i, value -> Pair(DICTIONARY_KEYS[i], value) } - } BsonObjectId::class -> if (nullable) { NULLABLE_BSON_OBJECT_ID_VALUES.mapIndexed { i, value -> Pair(DICTIONARY_KEYS_FOR_NULLABLE[i], value) diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmListTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmListTests.kt index 3103be611c..d4580e747a 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmListTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmListTests.kt @@ -39,7 +39,6 @@ import io.realm.kotlin.test.common.utils.GenericTypeSafetyManager import io.realm.kotlin.test.common.utils.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList @@ -686,7 +685,6 @@ class RealmListTests : EmbeddedObjectCollectionQueryTests { Decimal128::class -> if (nullable) NULLABLE_DECIMAL128_VALUES else DECIMAL128_VALUES String::class -> if (nullable) NULLABLE_STRING_VALUES else STRING_VALUES RealmInstant::class -> if (nullable) NULLABLE_TIMESTAMP_VALUES else TIMESTAMP_VALUES - ObjectId::class -> if (nullable) NULLABLE_OBJECT_ID_VALUES else OBJECT_ID_VALUES BsonObjectId::class -> if (nullable) NULLABLE_BSON_OBJECT_ID_VALUES else BSON_OBJECT_ID_VALUES RealmUUID::class -> if (nullable) NULLABLE_UUID_VALUES else UUID_VALUES ByteArray::class -> if (nullable) NULLABLE_BINARY_VALUES else BINARY_VALUES @@ -1379,8 +1377,6 @@ internal val DECIMAL128_VALUES = listOf(DECIMAL128_MAX_VALUE, DECIMAL128_MIN_VAL internal val BOOLEAN_VALUES = listOf(true, false) internal val TIMESTAMP_VALUES = listOf(RealmInstant.from(0, 0), RealmInstant.from(42, 420)) -internal val OBJECT_ID_VALUES = - listOf(ObjectId.create(), ObjectId.from("507f191e810c19729de860ea")) internal val BSON_OBJECT_ID_VALUES = listOf(BsonObjectId(), BsonObjectId("507f191e810c19729de860ea")) internal val UUID_VALUES = @@ -1428,7 +1424,6 @@ internal val NULLABLE_DOUBLE_VALUES = DOUBLE_VALUES + null internal val NULLABLE_DECIMAL128_VALUES = DECIMAL128_VALUES + null internal val NULLABLE_BOOLEAN_VALUES = BOOLEAN_VALUES + null internal val NULLABLE_TIMESTAMP_VALUES = TIMESTAMP_VALUES + null -internal val NULLABLE_OBJECT_ID_VALUES = OBJECT_ID_VALUES + null internal val NULLABLE_BSON_OBJECT_ID_VALUES = BSON_OBJECT_ID_VALUES + null internal val NULLABLE_UUID_VALUES = UUID_VALUES + null internal val NULLABLE_BINARY_VALUES = BINARY_VALUES + null diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSetTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSetTests.kt index 94c34d7a89..52329bb57c 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSetTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSetTests.kt @@ -34,7 +34,6 @@ import io.realm.kotlin.test.common.utils.GenericTypeSafetyManager import io.realm.kotlin.test.common.utils.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject @@ -692,7 +691,6 @@ fun getDataSetForCollectionClassifier( Decimal128::class -> if (nullable) NULLABLE_DECIMAL128_VALUES else DECIMAL128_VALUES String::class -> if (nullable) NULLABLE_STRING_VALUES else STRING_VALUES RealmInstant::class -> if (nullable) NULLABLE_TIMESTAMP_VALUES else TIMESTAMP_VALUES - ObjectId::class -> if (nullable) NULLABLE_OBJECT_ID_VALUES else OBJECT_ID_VALUES BsonObjectId::class -> if (nullable) NULLABLE_BSON_OBJECT_ID_VALUES else BSON_OBJECT_ID_VALUES RealmUUID::class -> if (nullable) NULLABLE_UUID_VALUES else UUID_VALUES ByteArray::class -> if (nullable) NULLABLE_BINARY_VALUES else BINARY_VALUES diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/SerializationTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/SerializationTests.kt index 580c8f2a1f..0d02750309 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/SerializationTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/SerializationTests.kt @@ -45,7 +45,6 @@ import io.realm.kotlin.test.common.utils.GenericTypeSafetyManager import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor import io.realm.kotlin.types.EmbeddedRealmObject -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -275,10 +274,6 @@ class SerializationTests { TypeDescriptor.elementTypes .filterNot { it.classifier == RealmAny::class } // tested in exhaustiveRealmAnyTester - .filterNot { - // filter out as it deprecated and we don't provide a serializer - it.classifier == ObjectId::class - } .forEach { elementType -> val property: KMutableProperty1 = when (elementType.nullable) { @@ -393,10 +388,6 @@ class SerializationTests { fun exhaustiveRealmListTest() { TypeDescriptor .allListFieldTypes - .filterNot { - // filter out as it deprecated and we don't provide a serializer - it.elementType.classifier == ObjectId::class - } .mapCollectionDataSets( properties = SerializableSample.listNonNullableProperties, nullableProperties = SerializableSample.listNullableProperties @@ -420,10 +411,6 @@ class SerializationTests { fun exhaustiveRealmSetTest() { TypeDescriptor .allSetFieldTypes - .filterNot { - // filter out as it deprecated and we don't provide a serializer - it.elementType.classifier == ObjectId::class - } .mapCollectionDataSets( properties = SerializableSample.setNonNullableProperties, nullableProperties = SerializableSample.setNullableProperties @@ -446,10 +433,6 @@ class SerializationTests { fun exhaustiveRealmDictTest() { TypeDescriptor .allDictionaryFieldTypes - .filterNot { - // filter out as it deprecated and we don't provide a serializer - it.elementType.classifier == ObjectId::class - } .map { fieldType: TypeDescriptor.RealmFieldType -> DictionaryTypeSafetyManager( dataSet = getDataSetForDictionaryClassifier( diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicMutableRealmObjectTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicMutableRealmObjectTests.kt index 32ee015f45..6fcfc90c19 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicMutableRealmObjectTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicMutableRealmObjectTests.kt @@ -53,7 +53,6 @@ import io.realm.kotlin.schema.ValuePropertyType import io.realm.kotlin.test.StandaloneDynamicMutableRealm import io.realm.kotlin.test.common.utils.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -228,28 +227,14 @@ class DynamicMutableRealmObjectTests { ) } RealmStorageType.OBJECT_ID -> { - when (name) { - Sample::nullableObjectIdField.name -> { - val value = ObjectId.create() - dynamicSample.set(name, value) - assertEquals(value, dynamicSample.getNullableValue(name)) - dynamicSample.set(name, null) - assertEquals( - null, - dynamicSample.getNullableValue(name) - ) - } - Sample::nullableBsonObjectIdField.name -> { - val value = BsonObjectId() - dynamicSample.set(name, value) - assertEquals(value, dynamicSample.getNullableValue(name)) - dynamicSample.set(name, null) - assertEquals( - null, - dynamicSample.getNullableValue(name) - ) - } - } + val value = BsonObjectId() + dynamicSample.set(name, value) + assertEquals(value, dynamicSample.getNullableValue(name)) + dynamicSample.set(name, null) + assertEquals( + null, + dynamicSample.getNullableValue(name) + ) } RealmStorageType.UUID -> { val value = RealmUUID.random() @@ -366,18 +351,9 @@ class DynamicMutableRealmObjectTests { assertEquals(value, dynamicSample.getValue(name)) } RealmStorageType.OBJECT_ID -> { - when (name) { - Sample::objectIdField.name -> { - val value = ObjectId.create() - dynamicSample.set(name, value) - assertEquals(value, dynamicSample.getValue(name)) - } - Sample::bsonObjectIdField.name -> { - val value = BsonObjectId() - dynamicSample.set(name, value) - assertEquals(value, dynamicSample.getValue(name)) - } - } + val value = BsonObjectId() + dynamicSample.set(name, value) + assertEquals(value, dynamicSample.getValue(name)) } RealmStorageType.UUID -> { val value = RealmUUID.random() @@ -495,20 +471,12 @@ class DynamicMutableRealmObjectTests { RealmInstant.from(100, 100), RealmInstant::class ) - RealmStorageType.OBJECT_ID -> when (name) { - Sample::nullableObjectIdListField.name -> assertionsForNullable( - dynamicSample.getNullableValueList(property.name), - property, - ObjectId.create(), - ObjectId::class - ) - Sample::nullableBsonObjectIdListField.name -> assertionsForNullable( - dynamicSample.getNullableValueList(property.name), - property, - BsonObjectId(), - BsonObjectId::class - ) - } + RealmStorageType.OBJECT_ID -> assertionsForNullable( + dynamicSample.getNullableValueList(property.name), + property, + BsonObjectId(), + BsonObjectId::class + ) RealmStorageType.UUID -> assertionsForNullable( dynamicSample.getNullableValueList(property.name), property, @@ -675,20 +643,12 @@ class DynamicMutableRealmObjectTests { RealmInstant.from(100, 100), RealmInstant::class ) - RealmStorageType.OBJECT_ID -> when (name) { - Sample::objectIdListField.name -> assertionsForValue( - dynamicSample.getValueList(property.name), - property, - ObjectId.create(), - ObjectId::class - ) - Sample::bsonObjectIdListField.name -> assertionsForValue( - dynamicSample.getValueList(property.name), - property, - BsonObjectId(), - BsonObjectId::class - ) - } + RealmStorageType.OBJECT_ID -> assertionsForValue( + dynamicSample.getValueList(property.name), + property, + BsonObjectId(), + BsonObjectId::class + ) RealmStorageType.UUID -> assertionsForValue( dynamicSample.getValueList(property.name), property, @@ -788,20 +748,12 @@ class DynamicMutableRealmObjectTests { RealmInstant.from(100, 100), RealmInstant::class ) - RealmStorageType.OBJECT_ID -> when (name) { - Sample::nullableObjectIdSetField.name -> assertionsForNullable( - dynamicSample.getNullableValueSet(property.name), - property, - ObjectId.create(), - ObjectId::class - ) - Sample::nullableBsonObjectIdSetField.name -> assertionsForNullable( - dynamicSample.getNullableValueSet(property.name), - property, - BsonObjectId(), - BsonObjectId::class - ) - } + RealmStorageType.OBJECT_ID -> assertionsForNullable( + dynamicSample.getNullableValueSet(property.name), + property, + BsonObjectId(), + BsonObjectId::class + ) RealmStorageType.UUID -> assertionsForNullable( dynamicSample.getNullableValueSet(property.name), property, @@ -957,20 +909,12 @@ class DynamicMutableRealmObjectTests { RealmInstant.from(100, 100), RealmInstant::class ) - RealmStorageType.OBJECT_ID -> when (name) { - Sample::objectIdSetField.name -> assertionsForValue( - dynamicSample.getValueSet(property.name), - property, - ObjectId.create(), - ObjectId::class - ) - Sample::bsonObjectIdSetField.name -> assertionsForValue( - dynamicSample.getValueSet(property.name), - property, - BsonObjectId(), - BsonObjectId::class - ) - } + RealmStorageType.OBJECT_ID -> assertionsForValue( + dynamicSample.getValueSet(property.name), + property, + BsonObjectId(), + BsonObjectId::class + ) RealmStorageType.UUID -> assertionsForValue( dynamicSample.getValueSet(property.name), property, @@ -1130,20 +1074,12 @@ class DynamicMutableRealmObjectTests { RealmInstant.from(100, 100), RealmInstant::class ) - RealmStorageType.OBJECT_ID -> when (name) { - Sample::objectIdSetField.name -> assertionsForNullable( - dynamicSample.getNullableValueDictionary(property.name), - property, - ObjectId.create(), - ObjectId::class - ) - Sample::bsonObjectIdSetField.name -> assertionsForNullable( - dynamicSample.getNullableValueDictionary(property.name), - property, - BsonObjectId(), - BsonObjectId::class - ) - } + RealmStorageType.OBJECT_ID -> assertionsForNullable( + dynamicSample.getNullableValueDictionary(property.name), + property, + BsonObjectId(), + BsonObjectId::class + ) RealmStorageType.UUID -> assertionsForNullable( dynamicSample.getNullableValueDictionary(property.name), property, @@ -1336,20 +1272,12 @@ class DynamicMutableRealmObjectTests { RealmInstant.from(100, 100), RealmInstant::class ) - RealmStorageType.OBJECT_ID -> when (name) { - Sample::objectIdSetField.name -> assertionsForValue( - dynamicSample.getValueDictionary(property.name), - property, - ObjectId.create(), - ObjectId::class - ) - Sample::bsonObjectIdSetField.name -> assertionsForValue( - dynamicSample.getValueDictionary(property.name), - property, - BsonObjectId(), - BsonObjectId::class - ) - } + RealmStorageType.OBJECT_ID -> assertionsForValue( + dynamicSample.getValueDictionary(property.name), + property, + BsonObjectId(), + BsonObjectId::class + ) RealmStorageType.UUID -> assertionsForValue( dynamicSample.getValueDictionary(property.name), property, diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicRealmObjectTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicRealmObjectTests.kt index e798e4a8b0..c8956a94f1 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicRealmObjectTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/dynamic/DynamicRealmObjectTests.kt @@ -46,7 +46,6 @@ import io.realm.kotlin.schema.SetPropertyType import io.realm.kotlin.schema.ValuePropertyType import io.realm.kotlin.test.common.utils.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -249,7 +248,7 @@ class DynamicRealmObjectTests { RealmStorageType.OBJECT_ID -> { assertEquals( null, - dynamicSample.getNullableValue(property.name) + dynamicSample.getNullableValue(property.name) ) assertEquals( null, @@ -401,42 +400,21 @@ class DynamicRealmObjectTests { ) } RealmStorageType.OBJECT_ID -> { - when (name) { - Sample::objectIdField.name -> { - assertEquals( - expectedSample.objectIdField, - dynamicSample.getValue(property.name) - ) - assertEquals( - expectedSample.objectIdField, - dynamicSample.getValue(property.name) - ) - assertEquals( - expectedSample.objectIdField, - dynamicSample.getValue( - property.name, - ObjectId::class - ) - ) - } - Sample::bsonObjectIdField.name -> { - assertEquals( - expectedSample.bsonObjectIdField, - dynamicSample.getValue(property.name) - ) - assertEquals( - expectedSample.bsonObjectIdField, - dynamicSample.getValue(property.name) - ) - assertEquals( - expectedSample.bsonObjectIdField, - dynamicSample.getValue( - property.name, - type.storageType.kClass - ) - ) - } - } + assertEquals( + expectedSample.bsonObjectIdField, + dynamicSample.getValue(property.name) + ) + assertEquals( + expectedSample.bsonObjectIdField, + dynamicSample.getValue(property.name) + ) + assertEquals( + expectedSample.bsonObjectIdField, + dynamicSample.getValue( + property.name, + type.storageType.kClass + ) + ) } RealmStorageType.UUID -> { assertEquals( @@ -575,29 +553,16 @@ class DynamicRealmObjectTests { ) ) } - RealmStorageType.OBJECT_ID -> when (name) { - Sample::nullableObjectIdField.name -> { - assertionsForNullable( - dynamicSample.getNullableValueList(property.name) - ) - assertionsForNullable( - dynamicSample.getNullableValueList( - property.name, - ObjectId::class - ) - ) - } - Sample::nullableBsonObjectIdField.name -> { - assertionsForNullable( - dynamicSample.getNullableValueList(property.name) - ) - assertionsForNullable( - dynamicSample.getNullableValueList( - property.name, - BsonObjectId::class - ) + RealmStorageType.OBJECT_ID -> { + assertionsForNullable( + dynamicSample.getNullableValueList(property.name) + ) + assertionsForNullable( + dynamicSample.getNullableValueList( + property.name, + BsonObjectId::class ) - } + ) } RealmStorageType.UUID -> { assertionsForNullable( @@ -734,36 +699,18 @@ class DynamicRealmObjectTests { ) } RealmStorageType.OBJECT_ID -> { - when (name) { - Sample::objectIdListField.name -> { - val expectedValue = defaultSample.objectIdField - assertEquals( - expectedValue, - dynamicSample.getValueList(property.name)[0] - ) - assertEquals( - expectedValue, - dynamicSample.getValueList( - property.name, - ObjectId::class - )[0] - ) - } - Sample::bsonObjectIdListField.name -> { - val expectedValue = defaultSample.bsonObjectIdField - assertEquals( - expectedValue, - dynamicSample.getValueList(property.name)[0] - ) - assertEquals( - expectedValue, - dynamicSample.getValueList( - property.name, - BsonObjectId::class - )[0] - ) - } - } + val expectedValue = defaultSample.bsonObjectIdField + assertEquals( + expectedValue, + dynamicSample.getValueList(property.name)[0] + ) + assertEquals( + expectedValue, + dynamicSample.getValueList( + property.name, + BsonObjectId::class + )[0] + ) } RealmStorageType.UUID -> { val expectedValue = defaultSample.uuidField @@ -866,34 +813,17 @@ class DynamicRealmObjectTests { ) } RealmStorageType.OBJECT_ID -> { - when (name) { - Sample::nullableObjectIdSetField.name -> { - assertionsForNullable( - dynamicSample.getNullableValueSet( - property.name - ) - ) - assertionsForNullable( - dynamicSample.getNullableValueSet( - property.name, - ObjectId::class - ) - ) - } - Sample::nullableBsonObjectIdSetField.name -> { - assertionsForNullable( - dynamicSample.getNullableValueSet( - property.name - ) - ) - assertionsForNullable( - dynamicSample.getNullableValueSet( - property.name, - BsonObjectId::class - ) - ) - } - } + assertionsForNullable( + dynamicSample.getNullableValueSet( + property.name + ) + ) + assertionsForNullable( + dynamicSample.getNullableValueSet( + property.name, + BsonObjectId::class + ) + ) } RealmStorageType.UUID -> { assertionsForNullable( @@ -1037,27 +967,15 @@ class DynamicRealmObjectTests { defaultSample.timestampField ) } - RealmStorageType.OBJECT_ID -> when (name) { - Sample::objectIdSetField.name -> { - assertionsForValue( - dynamicSample.getValueSet(property.name), - defaultSample.objectIdField - ) - assertionsForValue( - dynamicSample.getValueSet(property.name, ObjectId::class), - defaultSample.objectIdField - ) - } - Sample::bsonObjectIdSetField.name -> { - assertionsForValue( - dynamicSample.getValueSet(property.name), - defaultSample.bsonObjectIdField - ) - assertionsForValue( - dynamicSample.getValueSet(property.name, BsonObjectId::class), - defaultSample.bsonObjectIdField - ) - } + RealmStorageType.OBJECT_ID -> { + assertionsForValue( + dynamicSample.getValueSet(property.name), + defaultSample.bsonObjectIdField + ) + assertionsForValue( + dynamicSample.getValueSet(property.name, BsonObjectId::class), + defaultSample.bsonObjectIdField + ) } RealmStorageType.UUID -> { assertionsForValue( @@ -1236,35 +1154,18 @@ class DynamicRealmObjectTests { ) ) } - RealmStorageType.OBJECT_ID -> when (name) { - Sample::objectIdSetField.name -> { - assertionsForNullable( - dynamicSample.getNullableValueDictionary( - property.name - ) - ) - assertionsForNullable( - dynamicSample.getNullableValueDictionary( - property.name, - ObjectId::class - ) - ) - } - Sample::bsonObjectIdSetField.name -> { - val expectedValue = defaultSample.bsonObjectIdField - assertEquals( - expectedValue, - dynamicSample.getValueSet(property.name) - .first() + RealmStorageType.OBJECT_ID -> { + assertionsForNullable( + dynamicSample.getNullableValueDictionary( + property.name ) - assertEquals( - expectedValue, - dynamicSample.getValueSet( - property.name, - BsonObjectId::class - ).first() + ) + assertionsForNullable( + dynamicSample.getNullableValueDictionary( + property.name, + BsonObjectId::class ) - } + ) } RealmStorageType.UUID -> { assertionsForNullable( @@ -1353,16 +1254,10 @@ class DynamicRealmObjectTests { dynamicSample.getValueDictionary(property.name), defaultSample.timestampField ) - RealmStorageType.OBJECT_ID -> when (property.name) { - Sample::objectIdDictionaryField.name -> assertionsForValue( - dynamicSample.getValueDictionary(property.name), - defaultSample.objectIdField - ) - Sample::bsonObjectIdDictionaryField.name -> assertionsForValue( - dynamicSample.getValueDictionary(property.name), - defaultSample.bsonObjectIdField - ) - } + RealmStorageType.OBJECT_ID -> assertionsForValue( + dynamicSample.getValueDictionary(property.name), + defaultSample.bsonObjectIdField + ) RealmStorageType.UUID -> assertionsForValue( dynamicSample.getValueDictionary(property.name), defaultSample.uuidField @@ -1986,7 +1881,6 @@ class DynamicRealmObjectTests { stringListField.add(defaultSample.stringField) objectListField.add(this) timestampListField.add(defaultSample.timestampField) - objectIdListField.add(defaultSample.objectIdField) bsonObjectIdListField.add(defaultSample.bsonObjectIdField) uuidListField.add(defaultSample.uuidField) binaryListField.add(defaultSample.binaryField) @@ -2004,7 +1898,6 @@ class DynamicRealmObjectTests { objectSetField.add(this) timestampSetField.add(defaultSample.timestampField) bsonObjectIdSetField.add(defaultSample.bsonObjectIdField) - objectIdSetField.add(defaultSample.objectIdField) uuidSetField.add(defaultSample.uuidField) binarySetField.add(defaultSample.binaryField) decimal128SetField.add(defaultSample.decimal128Field) @@ -2020,7 +1913,6 @@ class DynamicRealmObjectTests { stringDictionaryField["A"] = defaultSample.stringField timestampDictionaryField["A"] = defaultSample.timestampField bsonObjectIdDictionaryField["A"] = defaultSample.bsonObjectIdField - objectIdDictionaryField["A"] = defaultSample.objectIdField uuidDictionaryField["A"] = defaultSample.uuidField binaryDictionaryField["A"] = defaultSample.binaryField decimal128DictionaryField["A"] = defaultSample.decimal128Field @@ -2036,7 +1928,6 @@ class DynamicRealmObjectTests { nullableDoubleListField.add(null) nullableTimestampListField.add(null) nullableBsonObjectIdListField.add(null) - nullableObjectIdListField.add(null) nullableUUIDListField.add(null) nullableBinaryListField.add(null) nullableDecimal128ListField.add(null) @@ -2052,7 +1943,6 @@ class DynamicRealmObjectTests { nullableDoubleSetField.add(null) nullableTimestampSetField.add(null) nullableBsonObjectIdSetField.add(null) - nullableObjectIdSetField.add(null) nullableUUIDSetField.add(null) nullableBinarySetField.add(null) nullableDecimal128SetField.add(null) @@ -2068,7 +1958,6 @@ class DynamicRealmObjectTests { nullableDoubleDictionaryField["A"] = null nullableTimestampDictionaryField["A"] = null nullableBsonObjectIdDictionaryField["A"] = null - nullableObjectIdDictionaryField["A"] = null nullableUUIDDictionaryField["A"] = null nullableBinaryDictionaryField["A"] = null nullableDecimal128DictionaryField["A"] = null diff --git a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/FullTextTests.kt b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/FullTextTests.kt index 2e4ca83d65..6dae18f7b8 100644 --- a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/FullTextTests.kt +++ b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/FullTextTests.kt @@ -24,7 +24,6 @@ import io.realm.kotlin.internal.interop.CollectionType import io.realm.kotlin.test.util.Compiler.compileFromSource import io.realm.kotlin.test.util.TypeDescriptor.allFieldTypes import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmUUID @@ -52,7 +51,6 @@ class FullTextTests { Decimal128::class to "BsonDecimal128(\"1.4E100\")", String::class to "\"Realm\"", RealmInstant::class to "RealmInstant.from(42, 420)", - ObjectId::class to "ObjectId.create()", BsonObjectId::class to "BsonObjectId()", RealmUUID::class to "RealmUUID.random()", ByteArray::class to "byteArrayOf(42)", @@ -77,7 +75,6 @@ class FullTextTests { "fulltext.kt", """ import io.realm.kotlin.types.MutableRealmInt - import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject diff --git a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt index b739edf85c..f485eb15b9 100644 --- a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt +++ b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt @@ -24,7 +24,6 @@ import io.realm.kotlin.internal.interop.CollectionType import io.realm.kotlin.test.util.Compiler.compileFromSource import io.realm.kotlin.test.util.TypeDescriptor.allFieldTypes import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmUUID @@ -52,7 +51,6 @@ class IndexTests { Decimal128::class to "BsonDecimal128(\"1.4E100\")", String::class to "\"Realm\"", RealmInstant::class to "RealmInstant.from(42, 420)", - ObjectId::class to "ObjectId.create()", BsonObjectId::class to "BsonObjectId()", RealmUUID::class to "RealmUUID.random()", ByteArray::class to "byteArrayOf(42)", @@ -77,7 +75,6 @@ class IndexTests { "indexing.kt", """ import io.realm.kotlin.types.MutableRealmInt - import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject diff --git a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt index 5acfc95da3..e5a4307c35 100644 --- a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt +++ b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt @@ -24,7 +24,6 @@ import io.realm.kotlin.internal.interop.CollectionType import io.realm.kotlin.test.util.Compiler.compileFromSource import io.realm.kotlin.test.util.TypeDescriptor.allFieldTypes import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmUUID import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi @@ -53,7 +52,6 @@ class PrimaryKeyTests { Decimal128::class to "BsonDecimal128(\"1.4E100\")", String::class to "\"Realm\"", RealmInstant::class to "RealmInstant.from(42, 420)", - ObjectId::class to "ObjectId.create()", BsonObjectId::class to "BsonObjectId()", RealmUUID::class to "RealmUUID.random()", ByteArray::class to "byteArrayOf(42)", @@ -76,7 +74,6 @@ class PrimaryKeyTests { "primaryKey.kt", """ import io.realm.kotlin.types.MutableRealmInt - import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject diff --git a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt index 53a72671cf..f2dccda213 100644 --- a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt +++ b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt @@ -47,7 +47,7 @@ internal const val OBJECT_CLASS = "SampleClass" private val COLLECTION_CODE = """ import io.realm.kotlin.types.EmbeddedRealmObject -import io.realm.kotlin.types.ObjectId + import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant diff --git a/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt b/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt index 63c074fe4e..b72debd629 100644 --- a/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt +++ b/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt @@ -22,7 +22,6 @@ import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.ext.realmSetOf import io.realm.kotlin.schema.RealmStorageType import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -31,6 +30,7 @@ import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.RealmSet import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.types.annotations.PrimaryKey +import org.mongodb.kbson.BsonObjectId import org.mongodb.kbson.Decimal128 import kotlin.random.Random @@ -55,7 +55,7 @@ class SyncObjectWithAllTypes : RealmObject { var floatField: Float = 0.0.toFloat() var decimal128Field: Decimal128 = Decimal128("0") var realmInstantField: RealmInstant = RealmInstant.MIN - var objectIdField: ObjectId = ObjectId.create() + var objectIdField: BsonObjectId = BsonObjectId() var realmUUIDField: RealmUUID = RealmUUID.random() var binaryField: ByteArray = byteArrayOf(42) var mutableRealmIntField: MutableRealmInt = MutableRealmInt.create(42) @@ -73,7 +73,7 @@ class SyncObjectWithAllTypes : RealmObject { var floatNullableField: Float? = null var decimal128NullableField: Decimal128? = null var realmInstantNullableField: RealmInstant? = null - var objectIdNullableField: ObjectId? = null + var objectIdNullableField: BsonObjectId? = null var realmUUIDNullableField: RealmUUID? = null var binaryNullableField: ByteArray? = null var objectNullableField: SyncObjectWithAllTypes? = null @@ -93,7 +93,7 @@ class SyncObjectWithAllTypes : RealmObject { var floatRealmList: RealmList = realmListOf(0.0.toFloat()) var decimal128RealmList: RealmList = realmListOf(Decimal128("0.0")) var realmInstantRealmList: RealmList = realmListOf(RealmInstant.MIN) - var objectIdRealmList: RealmList = realmListOf(ObjectId.create()) + var objectIdRealmList: RealmList = realmListOf(BsonObjectId()) var realmUUIDRealmList: RealmList = realmListOf(RealmUUID.random()) var binaryRealmList: RealmList = realmListOf(byteArrayOf(42)) var objectRealmList: RealmList = realmListOf() @@ -115,7 +115,7 @@ class SyncObjectWithAllTypes : RealmObject { var floatRealmSet: RealmSet = realmSetOf(0.0.toFloat()) var decimal128RealmSet: RealmSet = realmSetOf(Decimal128("0.0")) var realmInstantRealmSet: RealmSet = realmSetOf(RealmInstant.MIN) - var objectIdRealmSet: RealmSet = realmSetOf(ObjectId.create()) + var objectIdRealmSet: RealmSet = realmSetOf(BsonObjectId()) var realmUUIDRealmSet: RealmSet = realmSetOf(RealmUUID.random()) var binaryRealmSet: RealmSet = realmSetOf(byteArrayOf(42)) var objectRealmSet: RealmSet = realmSetOf() @@ -137,7 +137,7 @@ class SyncObjectWithAllTypes : RealmObject { var floatRealmDictionary: RealmDictionary = realmDictionaryOf("A" to 0.0.toFloat()) var decimal128RealmDictionary: RealmDictionary = realmDictionaryOf("A" to Decimal128("0.0")) var realmInstantRealmDictionary: RealmDictionary = realmDictionaryOf("A" to RealmInstant.MIN) - var objectIdRealmDictionary: RealmDictionary = realmDictionaryOf("A" to ObjectId.create()) + var objectIdRealmDictionary: RealmDictionary = realmDictionaryOf("A" to BsonObjectId()) var realmUUIDRealmDictionary: RealmDictionary = realmDictionaryOf("A" to RealmUUID.random()) var binaryRealmDictionary: RealmDictionary = realmDictionaryOf("A" to byteArrayOf(42)) @@ -401,9 +401,9 @@ class SyncObjectWithAllTypes : RealmObject { ) } RealmStorageType.OBJECT_ID -> { - val minObjId = ObjectId.from("000000000000000000000000") - val maxObjId = ObjectId.from("ffffffffffffffffffffffff") - val randomObjId = ObjectId.from("503f1f77bcf86cd793439011") + val minObjId = BsonObjectId("000000000000000000000000") + val maxObjId = BsonObjectId("ffffffffffffffffffffffff") + val randomObjId = BsonObjectId("503f1f77bcf86cd793439011") Pair( { obj: SyncObjectWithAllTypes -> obj.objectIdField = randomObjId diff --git a/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncPerson.kt b/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncPerson.kt index 6d85d90ac6..9a55c28d4f 100644 --- a/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncPerson.kt +++ b/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncPerson.kt @@ -16,14 +16,14 @@ package io.realm.kotlin.entities.sync -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.PrimaryKey +import org.mongodb.kbson.BsonObjectId class SyncPerson : RealmObject { @PrimaryKey @Suppress("VariableNaming") - var _id: ObjectId? = ObjectId.create() + var _id: BsonObjectId? = BsonObjectId() var age: Long = 0 var firstName: String = "" var lastName: String = "" diff --git a/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexChildObject.kt b/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexChildObject.kt index f8aef973e3..6d35ba2ad5 100644 --- a/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexChildObject.kt +++ b/packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexChildObject.kt @@ -16,9 +16,9 @@ package io.realm.kotlin.entities.sync.flx -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.PrimaryKey +import org.mongodb.kbson.BsonObjectId /** * Object used when testing Flexible Sync. @@ -26,7 +26,7 @@ import io.realm.kotlin.types.annotations.PrimaryKey class FlexChildObject : RealmObject { @PrimaryKey @Suppress("VariableNaming") - var _id: ObjectId = ObjectId.create() + var _id: BsonObjectId = BsonObjectId() var section: Int = 0 var name: String = "" } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/ApiKeyAuthTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/ApiKeyAuthTests.kt index a838d094d1..6b4e3f0add 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/ApiKeyAuthTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/ApiKeyAuthTests.kt @@ -23,7 +23,7 @@ import io.realm.kotlin.test.mongodb.TEST_APP_PARTITION import io.realm.kotlin.test.mongodb.TestApp import io.realm.kotlin.test.mongodb.common.utils.assertFailsWithMessage import io.realm.kotlin.test.util.TestHelper -import io.realm.kotlin.types.ObjectId +import org.mongodb.kbson.BsonObjectId import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Ignore @@ -102,7 +102,7 @@ class ApiKeyAuthTests { @Test fun fetch_nonExistingKeyThrows() = runBlocking { - assertNull(provider.fetch(ObjectId.create())) + assertNull(provider.fetch(BsonObjectId())) } @Test @@ -134,7 +134,7 @@ class ApiKeyAuthTests { provider.create(TestHelper.randomString("key-")) val keys = provider.fetchAll() assertEquals(1, keys.size) - provider.delete(ObjectId.create()) + provider.delete(BsonObjectId()) val keysAfterInvalidDelete = provider.fetchAll() assertEquals(1, keysAfterInvalidDelete.size) } @@ -163,7 +163,7 @@ class ApiKeyAuthTests { fun enable_nonExistingKeyThrows() { assertFailsWithMessage("[Service][ApiKeyNotFound(4334)] API key not found.") { runBlocking { - provider.enable(ObjectId.create()) + provider.enable(BsonObjectId()) } } } @@ -188,7 +188,7 @@ class ApiKeyAuthTests { fun disable_nonExistingKeyThrows() { assertFailsWithMessage("[Service][ApiKeyNotFound(4334)] API key not found.") { runBlocking { - provider.disable(ObjectId.create()) + provider.disable(BsonObjectId()) } } } @@ -203,11 +203,11 @@ class ApiKeyAuthTests { runBlocking { when (method) { Method.CREATE -> provider.create(TestHelper.randomString("key-")) - Method.FETCH_SINGLE -> provider.fetch(ObjectId.create()) + Method.FETCH_SINGLE -> provider.fetch(BsonObjectId()) Method.FETCH_ALL -> provider.fetchAll() - Method.DELETE -> provider.delete(ObjectId.create()) - Method.ENABLE -> provider.enable(ObjectId.create()) - Method.DISABLE -> provider.disable(ObjectId.create()) + Method.DELETE -> provider.delete(BsonObjectId()) + Method.ENABLE -> provider.enable(BsonObjectId()) + Method.DISABLE -> provider.disable(BsonObjectId()) } } } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt index cfd87265a1..2d55d79080 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt @@ -51,7 +51,6 @@ import io.realm.kotlin.test.mongodb.util.TestAppInitializer.VOID_FUNCTION import io.realm.kotlin.test.mongodb.util.TestAppInitializer.initializeDefault import io.realm.kotlin.test.util.TypeDescriptor import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant @@ -239,7 +238,6 @@ class FunctionsTests { .filterNot { classifier -> classifier in listOf( Decimal128::class, - ObjectId::class, // BsonType BsonObjectId::class // ) } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt index d3867e1d11..e090cd929c 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt @@ -52,11 +52,11 @@ import io.realm.kotlin.test.util.TestHelper import io.realm.kotlin.test.util.TestHelper.getRandomKey import io.realm.kotlin.test.util.TestHelper.randomEmail import io.realm.kotlin.test.util.use -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.RealmUUID import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.withContext +import org.mongodb.kbson.BsonObjectId import kotlin.random.Random import kotlin.reflect.KClass import kotlin.test.AfterTest @@ -417,8 +417,8 @@ class SyncConfigTests { ) ValueType.OBJECT_ID -> listOf( - ObjectId.from("62aafc72b9c357695ac489a7") to "o_62aafc72b9c357695ac489a7", - null as ObjectId? to "null", + BsonObjectId("62aafc72b9c357695ac489a7") to "o_62aafc72b9c357695ac489a7", + null as BsonObjectId? to "null", ) ValueType.UUID -> listOf( @@ -454,7 +454,7 @@ class SyncConfigTests { is String? -> SyncConfiguration.create(user, partitionValue, schema) is Int? -> SyncConfiguration.create(user, partitionValue, schema) is Long? -> SyncConfiguration.create(user, partitionValue, schema) - is ObjectId? -> SyncConfiguration.create(user, partitionValue, schema) + is BsonObjectId? -> SyncConfiguration.create(user, partitionValue, schema) is RealmUUID? -> SyncConfiguration.create(user, partitionValue, schema) else -> TODO("Undefined partition type") } @@ -467,7 +467,7 @@ class SyncConfigTests { is String? -> SyncConfiguration.Builder(user, partitionValue, schema).build() is Int? -> SyncConfiguration.Builder(user, partitionValue, schema).build() is Long? -> SyncConfiguration.Builder(user, partitionValue, schema).build() - is ObjectId? -> SyncConfiguration.Builder(user, partitionValue, schema).build() + is BsonObjectId? -> SyncConfiguration.Builder(user, partitionValue, schema).build() is RealmUUID? -> SyncConfiguration.Builder(user, partitionValue, schema).build() else -> TODO("Undefined partition type") } @@ -666,8 +666,8 @@ class SyncConfigTests { validateConfig(SyncConfiguration.Builder(user, 1L, supportedSchemaTypes).build()) } ValueType.OBJECT_ID -> { - validateConfig(SyncConfiguration.create(user, ObjectId.create(), supportedSchemaTypes)) - validateConfig(SyncConfiguration.Builder(user, ObjectId.create(), supportedSchemaTypes).build()) + validateConfig(SyncConfiguration.create(user, BsonObjectId(), supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, BsonObjectId(), supportedSchemaTypes).build()) } ValueType.UUID -> { validateConfig(SyncConfiguration.create(user, RealmUUID.random(), supportedSchemaTypes)) diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt index 9cba35ff51..4e69c60f8e 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt @@ -17,13 +17,11 @@ package io.realm.kotlin.test.mongodb.common.serializer -import io.realm.kotlin.ext.asBsonObjectId import io.realm.kotlin.internal.toDuration import io.realm.kotlin.mongodb.internal.BsonEncoder import io.realm.kotlin.test.mongodb.common.utils.assertFailsWithMessage import io.realm.kotlin.test.util.TypeDescriptor import io.realm.kotlin.types.MutableRealmInt -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject @@ -143,13 +141,6 @@ class BsonEncoderTests { bsonValue = BsonBinary(BsonBinarySubType.UUID_STANDARD, uuid.bytes), ) } - ObjectId::class -> ObjectId.create().let { objectId -> - DecoderAsserter( - type = ObjectId::class, - value = objectId, - bsonValue = objectId.asBsonObjectId(), - ) - } RealmInstant::class -> RealmInstant.from( epochSeconds = 1668425451, nanosecondAdjustment = 862000000 From db2488347d106edecd46615f56a25658f7176147 Mon Sep 17 00:00:00 2001 From: Clemente Date: Mon, 20 May 2024 12:26:40 +0200 Subject: [PATCH 2/7] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc41a998ba..d8ecf24d87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This release will bump the Realm file format from version 23 to 24. Opening a fi ### Breaking changes * Removed property `RealmLog.level`. Log levels can be set with `RealmLog.setLevel`. (Issue [#1691](https://github.com/realm/realm-kotlin/issues/1691) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1038)) * Removed `LogConfiguration`. Log levels and custom loggers can be set with `RealmLog`. (Issue [#1691](https://github.com/realm/realm-kotlin/issues/1691) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1038)) +* Removed deprecated `io.realm.kotlin.types.ObjectId`. Use `org.mongodb.kbson.BsonObjectId` or its type alias `org.mongodb.kbson.ObjectId` instead. (Issue [#1749](https://github.com/realm/realm-kotlin/issues/1749) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1082)) ### Enhancements * Support for RealmLists and RealmDictionaries in `RealmAny`. (Issue [#1434](https://github.com/realm/realm-kotlin/issues/1434)) From dfbe6c1fb6a0f1a143415ddda15fa2f48a9c295f Mon Sep 17 00:00:00 2001 From: Clemente Date: Mon, 20 May 2024 13:47:57 +0200 Subject: [PATCH 3/7] update examples & benchmark --- .../kotlin/io/realm/kotlin/benchmarks/Entities.kt | 6 +++--- .../kotlin/io/realm/example/kmmsample/AllTypes.kt | 6 +++--- packages/library-base/proguard-rules-consumer-common.pro | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/benchmarks/shared/src/commonMain/kotlin/io/realm/kotlin/benchmarks/Entities.kt b/benchmarks/shared/src/commonMain/kotlin/io/realm/kotlin/benchmarks/Entities.kt index f767b8d1fc..30f9d557e0 100644 --- a/benchmarks/shared/src/commonMain/kotlin/io/realm/kotlin/benchmarks/Entities.kt +++ b/benchmarks/shared/src/commonMain/kotlin/io/realm/kotlin/benchmarks/Entities.kt @@ -16,12 +16,12 @@ package io.realm.kotlin.benchmarks import io.realm.kotlin.ext.realmListOf -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.types.annotations.PrimaryKey +import org.mongodb.kbson.ObjectId import kotlin.reflect.KClass val SCHEMAS = mapOf( @@ -76,7 +76,7 @@ class WithPrimaryKey : RealmObject { var floatField: Float = 3.14f var doubleField: Double = 1.19840122 var timestampField: RealmInstant = RealmInstant.from(100, 1000) - var objectIdField: ObjectId = ObjectId.create() + var objectIdField: ObjectId = ObjectId() var uuidField: RealmUUID = RealmUUID.random() var objectField: WithPrimaryKey? = null var objectListField: RealmList = realmListOf() @@ -90,7 +90,7 @@ class Entity1 : RealmObject { var floatField: Float = 3.14f var doubleField: Double = 1.19840122 var timestampField: RealmInstant = RealmInstant.from(100, 1000) - var objectIdField: ObjectId = ObjectId.create() + var objectIdField: ObjectId = ObjectId() var uuidField: RealmUUID = RealmUUID.random() var objectField: Entity1? = null var objectListField: RealmList = realmListOf() diff --git a/examples/kmm-sample/shared/src/commonMain/kotlin/io/realm/example/kmmsample/AllTypes.kt b/examples/kmm-sample/shared/src/commonMain/kotlin/io/realm/example/kmmsample/AllTypes.kt index 8231e877b9..88126cdbd8 100644 --- a/examples/kmm-sample/shared/src/commonMain/kotlin/io/realm/example/kmmsample/AllTypes.kt +++ b/examples/kmm-sample/shared/src/commonMain/kotlin/io/realm/example/kmmsample/AllTypes.kt @@ -19,11 +19,11 @@ package io.realm.example.kmmsample import io.realm.kotlin.ext.backlinks import io.realm.kotlin.ext.realmListOf -import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.PrimaryKey +import org.mongodb.kbson.ObjectId // This class is included to make sure the compiler-plugin can handle various type, given the min/max // version of Kotlin this project is compiled against. @@ -43,7 +43,7 @@ class AllTypes : RealmObject { var doubleField: Double = 0.0 var floatField: Float = 0.0.toFloat() var realmInstantField: RealmInstant = RealmInstant.MIN - var objectIdField: ObjectId = ObjectId.create() + var objectIdField: ObjectId = ObjectId() var objectField: AllTypes? = null // Nullable types @@ -81,7 +81,7 @@ class AllTypes : RealmObject { var floatRealmListNullable: RealmList = realmListOf(null) var realmInstantRealmList: RealmList = realmListOf(RealmInstant.MIN) var realmInstantRealmListNullable: RealmList = realmListOf(null) - var objectIdRealmList: RealmList = realmListOf(ObjectId.create()) + var objectIdRealmList: RealmList = realmListOf(ObjectId()) var objectIdRealmListNullable: RealmList = realmListOf(null) var objectRealmList: RealmList = realmListOf() diff --git a/packages/library-base/proguard-rules-consumer-common.pro b/packages/library-base/proguard-rules-consumer-common.pro index 3d73db1d9a..9fc9815bde 100644 --- a/packages/library-base/proguard-rules-consumer-common.pro +++ b/packages/library-base/proguard-rules-consumer-common.pro @@ -1,9 +1,5 @@ ## Keep Companion classes and class.Companion member of all classes that can be used in our API to # allow calling realmObjectCompanionOrThrow and realmObjectCompanionOrNull on the classes --keep class io.realm.kotlin.types.ObjectId$Companion --keepclassmembers class io.realm.kotlin.types.ObjectId { - io.realm.kotlin.types.ObjectId$Companion Companion; -} -keep class io.realm.kotlin.types.RealmInstant$Companion -keepclassmembers class io.realm.kotlin.types.RealmInstant { io.realm.kotlin.types.RealmInstant$Companion Companion; From c54aa695fec5e6afa4c2e52843b85b1897ebc886 Mon Sep 17 00:00:00 2001 From: Clemente Date: Mon, 20 May 2024 15:54:06 +0200 Subject: [PATCH 4/7] Update expected exception message --- .../io/realm/kotlin/test/mongodb/common/FunctionsTests.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt index 2d55d79080..747b51c812 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt @@ -952,7 +952,7 @@ class FunctionsTests { @Test fun unknownFunction() { - assertFailsWithMessage("function not found: 'unknown'") { + assertFailsWithMessage("function not found") { runBlocking { functions.call("unknown", 32) } From 3c794c4c3f2563d906beb7aa8a12340b42d6d4e0 Mon Sep 17 00:00:00 2001 From: Clemente Date: Mon, 20 May 2024 20:36:01 +0200 Subject: [PATCH 5/7] bump aws farm test timeout --- .github/actions/run-android-device-farm-test/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/run-android-device-farm-test/action.yml b/.github/actions/run-android-device-farm-test/action.yml index 2d15f48b8f..524aac798c 100644 --- a/.github/actions/run-android-device-farm-test/action.yml +++ b/.github/actions/run-android-device-farm-test/action.yml @@ -41,6 +41,7 @@ runs: test_spec_file: test_spec-${{ inputs.app-id }}.yaml test_spec_type: APPIUM_PYTHON_TEST_SPEC remote_src: true + timeout: 3600 test_spec: | version: 0.1 phases: From 9da603b5d03569526c92140639622b489248576d Mon Sep 17 00:00:00 2001 From: Clemente Date: Tue, 21 May 2024 12:13:18 +0200 Subject: [PATCH 6/7] Add missing bsonobjectid test --- .../test/mongodb/common/serializer/BsonEncoderTests.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt index 4e69c60f8e..d8228b36ab 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/serializer/BsonEncoderTests.kt @@ -61,7 +61,6 @@ class BsonEncoderTests { private val primitiveAsserters = TypeDescriptor.classifiers .filter { (key, _) -> key != RealmAny::class && // Tested by `realmAnyEncoding` - key != BsonObjectId::class && // Tested by `encodeBsonValueToBsonValue` key != RealmObject::class // Non-primitives are not supported }.map { (key, _) -> when (key) { @@ -141,6 +140,11 @@ class BsonEncoderTests { bsonValue = BsonBinary(BsonBinarySubType.UUID_STANDARD, uuid.bytes), ) } + BsonObjectId::class -> DecoderAsserter( + type = BsonObjectId::class, + value = BsonObjectId("507f191e810c19729de860ea"), + bsonValue = BsonObjectId("507f191e810c19729de860ea") + ) RealmInstant::class -> RealmInstant.from( epochSeconds = 1668425451, nanosecondAdjustment = 862000000 From be94510535700b65787d702b27a8aa1af03de46d Mon Sep 17 00:00:00 2001 From: Clemente Date: Tue, 21 May 2024 13:06:43 +0200 Subject: [PATCH 7/7] Linting --- .../src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt index f2dccda213..525e1ae1bd 100644 --- a/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt +++ b/packages/test-base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/Utils.kt @@ -47,7 +47,6 @@ internal const val OBJECT_CLASS = "SampleClass" private val COLLECTION_CODE = """ import io.realm.kotlin.types.EmbeddedRealmObject - import io.realm.kotlin.types.RealmAny import io.realm.kotlin.types.RealmDictionary import io.realm.kotlin.types.RealmInstant