I might have found a regression between 3.3.2 and 3.4.0.
At this point I can not give a sample project but the setup of my model.
Correctly build a query which checks for non-emptiness across links. My model has the following structure:
Department has a RealmList<Page> pages.
Page has a RealmList<Element> elements
My query looks like the following:
realm.where(Department.class).isNotEmpty("pages.elements")
Correctly build the query without crashing.
java.lang.IllegalArgumentException: Illegal Argument: isNotEmpty() only works on String, byte[] and RealmList across links.
at io.realm.internal.TableQuery.nativeIsNotEmpty(Native Method)
at io.realm.internal.TableQuery.isNotEmpty(TableQuery.java:399)
at io.realm.RealmQuery.isNotEmpty(RealmQuery.java:1514)
I just switched to v3.4.0 and the crash occured. Reverting back to 3.3.2 'fixes' the issue.
At this point I can not give any sample code but hope to provide one at a later time.
Realm version(s): v3.3.2 and v3.4.0
Realm sync feature enabled: no
Android Studio version: Android Studio 3.0 Canary 4
Which Android version and device:
1: Android 8.0.0 Preview, Patch level May 5 2017, Pixel C tablet
2: Android 7.0, Patch Level June 1 2017, Samsung Galaxy S8
@degill I believe this is fixed in the latest snapshot by https://github.com/realm/realm-java/pull/4870 (and maybe https://github.com/realm/realm-java/pull/4889 ) can you please verify with 3.4.1-SNAPSHOT ? (if that doesn't exist, then it's 3.5.0-SNAPSHOT)
I can confirm that this bug does not occur with 3.5.0-SNAPSHOT.
I could have tested that myself. Sorry for not thinking about that. :-)
Well you can't know for sure if a bug's been fixed or not, right? :D
Thanks for checking, bugfix will be in next patch release I'd think.
@degill Thanks a lot for reporting this!! the fix will be released in the next release. Sorry for the inconvenience!!!