Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for frozen objects #6590

Merged
merged 72 commits into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
1ba6afd
WIP
cmelchior Aug 23, 2019
a3aee53
WIP
cmelchior Oct 1, 2019
6ffbbb4
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Oct 1, 2019
a370b73
Add preliminary support for frozen objects.
cmelchior Oct 9, 2019
dfd54a3
Add more tests + prevent change listeners
cmelchior Oct 10, 2019
9e2508d
Add support for frozen results and lists
cmelchior Oct 22, 2019
fed6d0c
Add support for freezing RealmResults, RealmList and RealmObject
cmelchior Oct 23, 2019
14f532d
Add support for tracking number of versions. Add frozen object suppor…
cmelchior Oct 23, 2019
8699064
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Oct 23, 2019
13ecf38
Implement equals for Realms
cmelchior Oct 23, 2019
24d7c42
Add support for freezing deleted and pending RealmObjects
cmelchior Oct 24, 2019
07c2712
Only cache 1 frozen instance
cmelchior Oct 25, 2019
9780e6f
Added frozen checks to all RxJava unit tests to expose changes required.
cmelchior Oct 25, 2019
b5cae66
Fix building objectServer variant
cmelchior Oct 30, 2019
4c53bee
Fix build issues
cmelchior Oct 30, 2019
6582b13
More test fixes
cmelchior Oct 30, 2019
44daeff
Fix Rx tests
cmelchior Oct 31, 2019
17d3236
Update changelog
cmelchior Oct 31, 2019
3d695dc
Add support for flowables on frozen objects
cmelchior Oct 31, 2019
2fa6677
Disable Javadoc (temporary)
cmelchior Oct 31, 2019
ec16f09
Fix tests
cmelchior Oct 31, 2019
6a4bac9
Upgrade benchmark library and add benchmark tests
cmelchior Oct 31, 2019
f6f6690
Add changelog entries
cmelchior Oct 31, 2019
a3d1c6a
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Nov 1, 2019
d728365
Cleanup. Fix some stub unit tests.
cmelchior Nov 1, 2019
9a39d7c
Cleanup and Javadoc
cmelchior Nov 1, 2019
38b5379
Fix Javadoc generation
cmelchior Nov 1, 2019
b3c48e5
Fix copyToRealm/insert. Fix closing frozen Realms across on other thr…
cmelchior Nov 4, 2019
0e340de
Fix building examples
cmelchior Nov 4, 2019
fe6b638
Remove BaseRealms.equals method again. It breaks Powermock and had qu…
cmelchior Nov 4, 2019
16e9b1c
Update changelog + fix Findbugs warning
cmelchior Nov 4, 2019
0f06bcc
Fix RealmObject.equals
cmelchior Nov 4, 2019
7a7ff21
Fix PMD warnings
cmelchior Nov 4, 2019
155df03
Fix tests
cmelchior Nov 5, 2019
44c7a5a
No need to suppress warning
cmelchior Nov 5, 2019
49b2b1e
Add more docs
cmelchior Nov 5, 2019
1b1150e
Fix Rx tests
cmelchior Nov 5, 2019
5757239
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Nov 5, 2019
170ab7d
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Nov 5, 2019
3f23f34
Remove newline
cmelchior Nov 5, 2019
cc7a0ac
Proper support for freeze in unmanaged RealmList
cmelchior Nov 5, 2019
b0a61f3
Temp disable JNI test (bug in Core6)
cmelchior Nov 5, 2019
eaaff99
CHANGELOG fixes
cmelchior Nov 6, 2019
8bd2be9
Update to latest OS
cmelchior Nov 13, 2019
6f131dd
Fix build errors after OS changes
cmelchior Nov 13, 2019
8ba0af5
Apply suggestions from code review
cmelchior Nov 13, 2019
96efb88
More PR feedback
cmelchior Nov 13, 2019
7d75eed
Fix return
cmelchior Nov 14, 2019
30f7dec
Fix more returns
cmelchior Nov 14, 2019
de267bf
Remove work-around for deleting Realms
cmelchior Nov 15, 2019
5d2f2e0
Update Sync + OS
cmelchior Nov 15, 2019
4555c2d
Update realm/realm-library/src/main/java/io/realm/RealmObject.java
nhachicha Nov 18, 2019
5c435a9
PR feedback
cmelchior Nov 18, 2019
3a8eb7d
Merge branch 'cm/core6/frozen-objects' of https://github.com/realm/re…
cmelchior Nov 18, 2019
71cb07b
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Nov 18, 2019
730583d
Include RxAndroid as part of the library instead as an dependency.
cmelchior Nov 18, 2019
8f2a047
Add Realm prefix to RxAndroid classes
cmelchior Nov 18, 2019
cbdd92d
Add better docs for maximumNumberOfActiveVersions for sync
cmelchior Nov 18, 2019
661b94f
Include RxAndroid but exclude RxJava from the transitive dependency
cmelchior Nov 18, 2019
511420e
Formatting
cmelchior Nov 19, 2019
805f4d5
Re-enable deleting Realms
cmelchior Nov 19, 2019
3ed5c8b
Hide warnings from RxAndroid
cmelchior Nov 20, 2019
7bccb94
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Nov 22, 2019
88ffd49
Update OS
cmelchior Nov 22, 2019
4d4a130
Make sure frozen Realms only flow from one location.
cmelchior Nov 25, 2019
e8b1d41
Merge branch 'nh/core-6' into cm/core6/frozen-objects
cmelchior Nov 25, 2019
19927be
Frozen API merged into OS
cmelchior Nov 25, 2019
776a98a
Update Core/Sync
cmelchior Nov 25, 2019
813bfed
Fix merge mistake
cmelchior Nov 25, 2019
30e786d
Fix RxJava test lifecycle issues.
cmelchior Nov 26, 2019
48c5240
Add better RxJava docs
cmelchior Nov 28, 2019
fef92a4
PR feedback
cmelchior Nov 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## 7.0.0(YYYY-MM-DD)

### Breaking Changes
* RxJava Flowables and Observables are now subscribed to and unsubscribed to asynchronously on the thread holding the live Realm, instead of previously where this was done synchronously.
nhachicha marked this conversation as resolved.
Show resolved Hide resolved
* All RxJava Flowables and Observables now return frozen objects instead of live objects. This can be configured using `RealmConfiguration.Builder.rxFactory(new RealmObservableFactory(true|false))`. By using frozen objects, it is possible to send RealmObjects across threads, which means that all RxJava operators should now be supported without the need to copy Realm data into unmanaged objects.
cmelchior marked this conversation as resolved.
Show resolved Hide resolved

### Enhancements
* Added `Realm.freeze()`, `RealmObject.freeze()`, `RealmResults.freeze()` and `RealmList.freeze()`. These methods will return a frozen version of the current Realm data. This data can be read from any thread without throwing an `IllegalStateException`, but will never change. All frozen Realms and data can be closed by calling `Realm.close()` on the frozen Realm, but fully closing all live Realms will also close the frozen ones. Frozen data can be queried as normal, but trying to mutate it in any way will throw an `IllegalStateException`. This includes all methods that attempt to refresh or add change listeners. (Issue [#6590](https://github.com/realm/realm-java/pull/6590))
* Added `Realm.isFrozen()`, `RealmObject.isFrozen()`, `RealmObject.isFrozen(RealmModel)`, `RealmResults.isFrozen()` and `RealmList.isFrozen()`, which returns whether or not the data is frozen.
* Added `RealmConfiguration.Builder.maxNumberOfActiveVersions(long number)`. Setting this will cause Realm to throw an `IllegalStateException` if too many versions of the Realm data are live at the same time. Having too many versions can dramatically increase the filesize of the Realm.

### Compatibility
* Realm Object Server: 3.23.1 or later.
* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
* APIs are backwards compatible with all previous release of realm-java in the 6.x.y series.

### Internal
* `OsSharedRealm.VersionID.hashCode()` was not implemented correctly and included the memory location in the hashcode.
* OKHttp was upgraded to 3.10.0 from 3.9.0.


## 6.0.2(2019-11-21)

### Enhancements
Expand Down
5 changes: 2 additions & 3 deletions examples/objectServerExample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.20'
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
Expand All @@ -11,9 +11,9 @@ buildscript {
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'

android {
Expand Down Expand Up @@ -45,7 +45,6 @@ android {
debug {
buildConfigField "String", "REALM_AUTH_URL", "${realmAuthUrl}"
buildConfigField "String", "REALM_URL", "${realmUrl}"
minifyEnabled true
}
release {
buildConfigField "String", "REALM_AUTH_URL", "${realmAuthUrl}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*
* Copyright 2019 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.benchmarks

import androidx.benchmark.junit4.BenchmarkRule
import androidx.benchmark.junit4.measureRepeated
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import io.realm.Realm
import io.realm.RealmConfiguration
import io.realm.RealmList
import io.realm.RealmResults
import io.realm.benchmarks.entities.AllTypes
import io.realm.kotlin.createObject
import io.realm.kotlin.where
import io.realm.log.RealmLog
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import java.util.*

@RunWith(AndroidJUnit4::class)
class FrozenObjectsBenchmarks {

@get:Rule
val benchmarkRule = BenchmarkRule()

private lateinit var realm: Realm
private lateinit var readObject: AllTypes
private lateinit var realmConfig: RealmConfiguration

@Before
fun setUp() {
Realm.init(InstrumentationRegistry.getInstrumentation().context)
RealmLog.error("SETUP")
realmConfig = RealmConfiguration.Builder().name("frozen${Random().nextLong()}.realm").build()
realm = Realm.getInstance(realmConfig)
realm.executeTransaction { realm ->
readObject = realm.createObject(AllTypes::class.java)
readObject.columnString = "Foo"
readObject.columnLong = 42
readObject.columnDouble = 1.234
}
}

@After
fun tearDown() {
RealmLog.error("TEAR_DOWN");
realm.close()
}

@Test
fun freezeRealm() {
benchmarkRule.measureRepeated {
// Skip caching in Java and directly measure how fast it is to freeze the SharedRealm.
// ObjectStore do not cache it, so it should be safe to run in a loop.
realm.sharedRealm.freeze()
}
}

@Test
fun freezeResults() {
realm.executeTransaction { r ->
for (i in 0..10_0000) {
val obj = r.createObject<AllTypes>()
obj.columnString= "String: " + i
obj.columnLong = i.toLong()
obj.isColumnBoolean = (i % 2 == 0)
}
}

var results: RealmResults<AllTypes> = realm.where<AllTypes>().findAll()
benchmarkRule.measureRepeated {
results.freeze()
}
}

@Test
fun freezeList() {
var list: RealmList<AllTypes> = RealmList()
realm.executeTransaction { r ->
for (i in 0..10_0000) {
list = readObject.columnRealmList
val obj = r.createObject<AllTypes>()
obj.columnString= "String: " + i
obj.columnLong = i.toLong()
obj.isColumnBoolean = (i % 2 == 0)
list.add(obj)
}
}

benchmarkRule.measureRepeated {
list.freeze()
}
}

@Test
fun freezeObject() {
benchmarkRule.measureRepeated {
readObject.freeze<AllTypes>()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class RealmProxyClassGenerator(private val processingEnvironment: ProcessingEnvi
"Map<RealmModel,RealmObjectProxy>", "cache",
"Set<ImportFlag>", "flags")

beginControlFlow("if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null)")
beginControlFlow("if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null)")
emitStatement("final BaseRealm otherRealm = ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm()")
beginControlFlow("if (otherRealm.threadId != realm.threadId)")
emitStatement("throw new IllegalArgumentException(\"Objects which belong to Realm instances in other threads cannot be copied into this Realm instance.\")")
Expand Down Expand Up @@ -948,7 +948,7 @@ class RealmProxyClassGenerator(private val processingEnvironment: ProcessingEnvi
beginMethod("long","insert", EnumSet.of(Modifier.PUBLIC, Modifier.STATIC), "Realm", "realm", qualifiedJavaClassName.toString(), "object", "Map<RealmModel,Long>", "cache")

// If object is already in the Realm there is nothing to update
beginControlFlow("if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
beginControlFlow("if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
emitStatement("return ((RealmObjectProxy) object).realmGet\$proxyState().getRow\$realm().getObjectKey()")
endControlFlow()

Expand Down Expand Up @@ -1040,7 +1040,7 @@ class RealmProxyClassGenerator(private val processingEnvironment: ProcessingEnvi
beginControlFlow("if (cache.containsKey(object))")
emitStatement("continue")
endControlFlow()
beginControlFlow("if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
beginControlFlow("if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
emitStatement("cache.put(object, ((RealmObjectProxy) object).realmGet\$proxyState().getRow\$realm().getObjectKey())")
emitStatement("continue")
endControlFlow()
Expand Down Expand Up @@ -1109,7 +1109,7 @@ class RealmProxyClassGenerator(private val processingEnvironment: ProcessingEnvi
beginMethod("long", "insertOrUpdate", EnumSet.of(Modifier.PUBLIC, Modifier.STATIC), "Realm", "realm", qualifiedJavaClassName.toString(), "object", "Map<RealmModel,Long>", "cache")

// If object is already in the Realm there is nothing to update
beginControlFlow("if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
beginControlFlow("if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
emitStatement("return ((RealmObjectProxy) object).realmGet\$proxyState().getRow\$realm().getObjectKey()")
endControlFlow()
emitStatement("Table table = realm.getTable(%s.class)", qualifiedJavaClassName)
Expand Down Expand Up @@ -1215,7 +1215,7 @@ class RealmProxyClassGenerator(private val processingEnvironment: ProcessingEnvi
emitStatement("continue")
endControlFlow()

beginControlFlow("if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
beginControlFlow("if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm() != null && ((RealmObjectProxy) object).realmGet\$proxyState().getRealm\$realm().getPath().equals(realm.getPath()))")
emitStatement("cache.put(object, ((RealmObjectProxy) object).realmGet\$proxyState().getRow\$realm().getObjectKey())")
emitStatement("continue")
endControlFlow()
Expand Down Expand Up @@ -1694,9 +1694,15 @@ class RealmProxyClassGenerator(private val processingEnvironment: ProcessingEnvi
emitStatement("if (o == null || getClass() != o.getClass()) return false")
emitStatement("%s %s = (%s)o", proxyClassName, otherObjectVarName, proxyClassName) // FooRealmProxy aFoo = (FooRealmProxy)o
emitEmptyLine()
emitStatement("String path = proxyState.getRealm\$realm().getPath()")
emitStatement("String otherPath = %s.proxyState.getRealm\$realm().getPath()", otherObjectVarName)
emitStatement("BaseRealm realm = proxyState.getRealm\$realm()")
emitStatement("BaseRealm otherRealm = %s.proxyState.getRealm\$realm()", otherObjectVarName)
emitStatement("String path = realm.getPath()")
emitStatement("String otherPath = otherRealm.getPath()")
emitStatement("if (path != null ? !path.equals(otherPath) : otherPath != null) return false")
emitStatement("if (realm.isFrozen() != otherRealm.isFrozen()) return false")
beginControlFlow("if (!realm.sharedRealm.getVersionID().equals(otherRealm.sharedRealm.getVersionID()))")
emitStatement("return false")
endControlFlow()
emitEmptyLine()
emitStatement("String tableName = proxyState.getRow\$realm().getTable().getName()")
emitStatement("String otherTableName = %s.proxyState.getRow\$realm().getTable().getName()", otherObjectVarName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ private static some_test_AllTypesRealmProxy newProxyInstance(BaseRealm realm, Ro
}

public static some.test.AllTypes copyOrUpdate(Realm realm, AllTypesColumnInfo columnInfo, some.test.AllTypes object, boolean update, Map<RealmModel,RealmObjectProxy> cache, Set<ImportFlag> flags) {
if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null) {
if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null) {
final BaseRealm otherRealm = ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm();
if (otherRealm.threadId != realm.threadId) {
throw new IllegalArgumentException("Objects which belong to Realm instances in other threads cannot be copied into this Realm instance.");
Expand Down Expand Up @@ -1280,7 +1280,7 @@ public static some.test.AllTypes copy(Realm realm, AllTypesColumnInfo columnInfo
}

public static long insert(Realm realm, some.test.AllTypes object, Map<RealmModel,Long> cache) {
if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
return ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey();
}
Table table = realm.getTable(some.test.AllTypes.class);
Expand Down Expand Up @@ -1471,7 +1471,7 @@ public static void insert(Realm realm, Iterator<? extends RealmModel> objects, M
if (cache.containsKey(object)) {
continue;
}
if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
cache.put(object, ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey());
continue;
}
Expand Down Expand Up @@ -1649,7 +1649,7 @@ public static void insert(Realm realm, Iterator<? extends RealmModel> objects, M
}

public static long insertOrUpdate(Realm realm, some.test.AllTypes object, Map<RealmModel,Long> cache) {
if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
return ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey();
}
Table table = realm.getTable(some.test.AllTypes.class);
Expand Down Expand Up @@ -1881,7 +1881,7 @@ public static void insertOrUpdate(Realm realm, Iterator<? extends RealmModel> ob
if (cache.containsKey(object)) {
continue;
}
if (object instanceof RealmObjectProxy && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
if (object instanceof RealmObjectProxy && !RealmObject.isFrozen(object) && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm() != null && ((RealmObjectProxy) object).realmGet$proxyState().getRealm$realm().getPath().equals(realm.getPath())) {
cache.put(object, ((RealmObjectProxy) object).realmGet$proxyState().getRow$realm().getObjectKey());
continue;
}
Expand Down Expand Up @@ -2349,9 +2349,15 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
some_test_AllTypesRealmProxy aAllTypes = (some_test_AllTypesRealmProxy)o;

String path = proxyState.getRealm$realm().getPath();
String otherPath = aAllTypes.proxyState.getRealm$realm().getPath();
BaseRealm realm = proxyState.getRealm$realm();
BaseRealm otherRealm = aAllTypes.proxyState.getRealm$realm();
String path = realm.getPath();
String otherPath = otherRealm.getPath();
if (path != null ? !path.equals(otherPath) : otherPath != null) return false;
if (realm.isFrozen() != otherRealm.isFrozen()) return false;
if (!realm.sharedRealm.getVersionID().equals(otherRealm.sharedRealm.getVersionID())) {
return false;
}

String tableName = proxyState.getRow$realm().getTable().getName();
String otherTableName = aAllTypes.proxyState.getRow$realm().getTable().getName();
Expand Down
Loading