Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
501d6b2
Merge branch 'master-4.0' into my/primitive_list_6_OsList
zaki50 Sep 6, 2017
80c963e
Merge branch 'my/primitive_list_6_OsList' into my/primitive_list_7_Sc…
zaki50 Sep 6, 2017
d4333f1
Merge branch 'my/primitive_list_7_Schema' into my/primitive_list_8_an…
zaki50 Sep 6, 2017
b305367
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 6, 2017
c48bee2
throw an exception if query or aggregation feature is used for primit…
zaki50 Sep 6, 2017
8b07850
add realm field types
zaki50 Sep 6, 2017
df0e6a0
SchemaInfo for primitive list
zaki50 Sep 6, 2017
7c420cc
Merge branch 'my/primitive_list_7_Schema' into my/primitive_list_8_an…
zaki50 Sep 6, 2017
ed554e9
fix a bug
zaki50 Sep 6, 2017
392a877
Merge branch 'my/primitive_list_7_Schema' into my/primitive_list_8_an…
zaki50 Sep 6, 2017
2f38412
fix a bug
zaki50 Sep 6, 2017
395fc8b
Merge branch 'my/primitive_list_7_Schema' into my/primitive_list_8_an…
zaki50 Sep 6, 2017
86bd3d4
fix tests
zaki50 Sep 6, 2017
a097d8f
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 6, 2017
1892469
Merge branch 'master-4.0' into feature/primitive_list
zaki50 Sep 6, 2017
8cd8e13
Merge branch 'feature/primitive_list' into my/primitive_list_6_OsList
zaki50 Sep 6, 2017
cdf9585
Merge branch 'my/primitive_list_6_OsList' into my/primitive_list_7_Sc…
zaki50 Sep 6, 2017
ba3daaa
Merge branch 'my/primitive_list_7_Schema' into my/primitive_list_8_an…
zaki50 Sep 6, 2017
2b007a4
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 6, 2017
84aca51
address findbugs issues
zaki50 Sep 6, 2017
94b109b
added Javadoc comment and RealmList.toArray()
zaki50 Sep 6, 2017
04c04c1
fix bug
zaki50 Sep 7, 2017
c505b4d
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 7, 2017
799ee7e
Draft implementation of accessor context
beeender Sep 7, 2017
c1d2396
implement Primitive List logic for copy() and insert()
zaki50 Sep 7, 2017
9654a68
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 7, 2017
5243cd6
implement Primitive List logic for insert(Realm, Iterator,...)
zaki50 Sep 7, 2017
36c23ec
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 7, 2017
7cc7ae5
generate code for primitive list in update(), insertOrUpdate()
zaki50 Sep 7, 2017
8fb4430
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 7, 2017
535563c
minor refactoring
zaki50 Sep 7, 2017
125b88b
Merge branch 'master-4.0' into feature/primitive_list
zaki50 Sep 7, 2017
d00f93f
Merge branch 'feature/primitive_list' into my/primitive_list_6_OsList
zaki50 Sep 7, 2017
d863ddc
Merge branch 'my/primitive_list_6_OsList' into my/primitive_list_7_Sc…
zaki50 Sep 7, 2017
4e16256
Merge branch 'my/primitive_list_7_Schema' into my/primitive_list_8_an…
zaki50 Sep 7, 2017
3a9cc02
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 7, 2017
53d88ee
implement primitive list supprt for copyFromRealm()
zaki50 Sep 7, 2017
40a2006
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 7, 2017
2715ce4
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 7, 2017
1464120
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 7, 2017
780bb4b
Merge branch 'master' into feature/primitive_list
zaki50 Sep 7, 2017
de1355d
Merge branch 'feature/primitive_list' into my/primitive_list_6_OsList
zaki50 Sep 7, 2017
d37e6a2
Merge branch 'my/primitive_list_6_OsList' into my/primitive_list_7_Sc…
zaki50 Sep 7, 2017
7d57d50
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 7, 2017
7e81516
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 7, 2017
b328e39
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 7, 2017
7d48934
fixed a bug that getFieldType returns UNSUPPORTED_TABLE and isColumnN…
zaki50 Sep 8, 2017
5627cb1
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 8, 2017
a43e1a7
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 8, 2017
b50a4d4
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 8, 2017
6738f1d
added a test to get field meta data of primitive lists
zaki50 Sep 8, 2017
af7cec4
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 8, 2017
202f59a
Merge remote-tracking branch 'origin/master' into feature/primitive_list
beeender Sep 8, 2017
32d3aba
Merge branch 'feature/primitive_list' into my/primitive_list_6_OsList
beeender Sep 8, 2017
094437f
Merge branch 'my/primitive_list_6_OsList' into my/primitive_list_7_Sc…
beeender Sep 8, 2017
3417036
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
beeender Sep 8, 2017
965def3
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
beeender Sep 8, 2017
7c9ed74
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
beeender Sep 8, 2017
87300f2
Add accessor context for string and bytes[]
beeender Sep 8, 2017
5d3e7b3
fix test
zaki50 Sep 8, 2017
0990d92
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 8, 2017
2f5d0f0
fix #5233
zaki50 Sep 9, 2017
b6f7930
move ManagedListOperator classes from the inside of RealmList to outside
zaki50 Sep 9, 2017
60aafd1
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 9, 2017
35dfd99
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 9, 2017
b18a135
Commit missing file
beeender Sep 11, 2017
ac3beb0
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 11, 2017
6e83c90
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 11, 2017
1ee2cf4
reformat code
zaki50 Sep 11, 2017
a2c65f3
Changed to throw IllegalArgumentException instead of IllegalStateExce…
zaki50 Sep 11, 2017
ebac9c1
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 11, 2017
625c3d6
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 11, 2017
5955ef4
Implement special handling for byte[] in RealmList
zaki50 Sep 11, 2017
24fa44b
Merge branch 'master' into feature/primitive_list
zaki50 Sep 11, 2017
82ac176
Merge branch 'feature/primitive_list' into my/primitive_list_6_OsList
zaki50 Sep 11, 2017
146bc19
Merge branch 'my/primitive_list_6_OsList' into my/primitive_list_7_Sc…
zaki50 Sep 11, 2017
a4b4d72
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 11, 2017
439c69a
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 11, 2017
4c6ac92
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 11, 2017
8560532
Fix build on x86_64
beeender Sep 11, 2017
a0db053
avoid unnecessary looping
zaki50 Sep 11, 2017
b7ab7d7
use fqcn when makeing a string of value type.
zaki50 Sep 11, 2017
e837379
fix RealmList.toString()
zaki50 Sep 11, 2017
0fb5ed3
Primitive List feature(Part6: OsList) (#5208)
zaki50 Sep 11, 2017
afaf891
Merge branch 'master' into feature/primitive_list
zaki50 Sep 11, 2017
df751f6
Merge commit '0fb5ed3' into feature/primitive_list
zaki50 Sep 11, 2017
c47c203
Merge branch 'feature/primitive_list' into my/primitive_list_7_Schema
zaki50 Sep 11, 2017
cea9a95
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 11, 2017
477845e
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 11, 2017
2183bc9
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 11, 2017
8063604
Fix findbugs
beeender Sep 12, 2017
c7cf446
fix a bug
zaki50 Sep 12, 2017
ccd95a2
Merge branch 'master' into feature/primitive_list
zaki50 Sep 12, 2017
0720b06
Merge branch 'feature/primitive_list' into my/primitive_list_7_Schema
zaki50 Sep 12, 2017
0c74291
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 12, 2017
3b74154
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 12, 2017
dfa644d
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 12, 2017
ff3c205
Remove RealmFieldType.isList()
beeender Sep 12, 2017
ea0c317
Rephrase
beeender Sep 12, 2017
66557fd
fix bugs
zaki50 Sep 12, 2017
b4ff2e0
add instrumentation tests
zaki50 Sep 12, 2017
674c647
Merge branch 'master' into feature/primitive_list
zaki50 Sep 12, 2017
bbb925d
Merge branch 'feature/primitive_list' into my/primitive_list_7_Schema
zaki50 Sep 12, 2017
55f5663
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 12, 2017
192f572
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 12, 2017
665a090
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 12, 2017
e2e2d93
remove unused variable
zaki50 Sep 12, 2017
494578f
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 12, 2017
9df91fa
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 12, 2017
1bfcbec
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 12, 2017
0ad34c4
fix a bug that annotation processor always generates schema of primit…
zaki50 Sep 12, 2017
27f2212
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 12, 2017
6b67f01
add a constructor to create non-null primitive list
zaki50 Sep 12, 2017
f1cdcb6
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 12, 2017
87e6ed9
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 12, 2017
4f62fa6
fix nativeIsColumnNullable
zaki50 Sep 12, 2017
38b25a5
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 12, 2017
873ab52
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 12, 2017
ef24542
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 12, 2017
4044eb6
fix compilation error
zaki50 Sep 12, 2017
6f1788e
Merge branch 'my/primitive_list_7_Schema' into mc/primitive_list_10_o…
zaki50 Sep 12, 2017
50a7ba8
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 12, 2017
375d3d9
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 12, 2017
676c6e3
fix implementation of RealmList.remove(Object)
zaki50 Sep 12, 2017
f354cea
fix RealmListTests
zaki50 Sep 12, 2017
57be25f
fix RealmListTests
zaki50 Sep 12, 2017
8ff3de5
Handle non-null primitive list in JNI
beeender Sep 13, 2017
d790a86
Primitive List feature(Part7: Schema) (#5209)
zaki50 Sep 13, 2017
c364668
Merge branch 'feature/primitive_list' into mc/primitive_list_10_oslis…
zaki50 Sep 13, 2017
e35ff91
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 13, 2017
ab29e5d
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 13, 2017
4211526
added tests for 'copyToRealm()' and 'copyFromRealm()'
zaki50 Sep 13, 2017
f4c75f6
added tests for non-null primitive list
zaki50 Sep 13, 2017
d48107a
fix test
zaki50 Sep 13, 2017
ec0feef
introduced OsObjectSchemaInfoaddPersistedValueListProperty() for prim…
zaki50 Sep 13, 2017
067bd1f
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 13, 2017
e6549f7
use OsObjectSchemaInfo.addPersistedValueListProperty()
zaki50 Sep 13, 2017
072518d
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 13, 2017
2fd41f0
reformat
zaki50 Sep 13, 2017
f3f734d
Move list type check to CheckedRow
beeender Sep 13, 2017
637790e
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 13, 2017
2864ab1
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 13, 2017
787b1cc
add size check to OsListTests.addNull_insertNull_setNull_requiredList…
zaki50 Sep 13, 2017
65cb83c
fix test
zaki50 Sep 13, 2017
86561b5
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 13, 2017
69fbdf5
introduce Row.getModelList() and Row.getValueList() to check field ty…
zaki50 Sep 13, 2017
4f99c61
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 13, 2017
0e5b09e
Check nullable and throw ealier in JNI
beeender Sep 14, 2017
f276882
Remove fixme and useless code
beeender Sep 14, 2017
d0a0334
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 14, 2017
92d0765
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 14, 2017
cf120e2
update nullablility annotations
zaki50 Sep 14, 2017
ec053e0
Merge branch 'mc/primitive_list_10_oslist_JNI' into my/primitive_list…
zaki50 Sep 14, 2017
889f892
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 14, 2017
d4ee982
update test case to expose an issue
zaki50 Sep 14, 2017
815bad7
Revert non-related changes
beeender Sep 14, 2017
b22c309
address review feedback
zaki50 Sep 14, 2017
d9707d7
add notice to Realm.*Json*()
zaki50 Sep 14, 2017
77d68cf
simplify Proxy's createDetachedCopy()
zaki50 Sep 14, 2017
a0fb560
Support listener on OsList
beeender Sep 14, 2017
7961a64
Merge pull request #5216 from realm/mc/primitive_list_10_oslist_JNI
beeender Sep 14, 2017
4400ab3
stop to add backlink field into nullable field list
zaki50 Sep 14, 2017
8c9e60f
add comments to ClassMetaData.hasRequiredAnnotation() and ClassMetaD…
zaki50 Sep 14, 2017
557f216
move Utils.getRealmListElementTypeMirror() to TypeMirrors class.
zaki50 Sep 14, 2017
1fd1b00
fix exception message
zaki50 Sep 14, 2017
c036e8c
add class comment to TypeMirrors
zaki50 Sep 14, 2017
76cbde4
add TODO comment
zaki50 Sep 14, 2017
c1dc3f0
Merge branch 'feature/primitive_list' into my/primitive_list_8_annota…
zaki50 Sep 14, 2017
7f0ed76
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 14, 2017
3d611a7
Merge branch 'my/primitive_list_9_RealmList' into mc/primitive_list_1…
zaki50 Sep 14, 2017
0c8dde8
Merge branch 'master' into feature/primitive_list
zaki50 Sep 14, 2017
88b4b66
Merge branch 'feature/primitive_list' into my/primitive_list_8_annota…
zaki50 Sep 14, 2017
3241a87
Merge branch 'my/primitive_list_8_annotation_processor' into my/primi…
zaki50 Sep 14, 2017
ef2aa91
Merge branch 'my/primitive_list_9_RealmList' into mc/primitive_list_1…
zaki50 Sep 14, 2017
9811cbe
Primitive List feature(Part8: Annotation processor implementation) (#…
zaki50 Sep 15, 2017
70d83aa
Merge branch 'feature/primitive_list' into my/primitive_list_9_RealmList
zaki50 Sep 15, 2017
e179fd5
Merge branch 'my/primitive_list_9_RealmList' into mc/primitive_list_1…
zaki50 Sep 15, 2017
db550a7
remove outdate comment
zaki50 Sep 15, 2017
078041a
fix todo comment
zaki50 Sep 15, 2017
5f9dbd4
use custom deleter for shared_ptr<char> that contains char[]
zaki50 Sep 15, 2017
7874296
fix failing test
zaki50 Sep 16, 2017
eebf152
remove methods to return primitive array
zaki50 Sep 16, 2017
1da98b7
Merge branch 'master' into feature/primitive_list
zaki50 Sep 16, 2017
fda1d0e
Merge branch 'feature/primitive_list' into my/primitive_list_9_RealmList
zaki50 Sep 16, 2017
ae6e91d
Merge branch 'my/primitive_list_9_RealmList' into mc/primitive_list_1…
zaki50 Sep 16, 2017
786e63d
Merge branch 'my/primitive_list_9_RealmList' into my/primitive_list_1…
zaki50 Sep 16, 2017
bb43a16
Using constans defined in Table class
zaki50 Sep 16, 2017
4f5cb68
use assertArrayEquals() instead of assertTrue(Arrays.equals())
zaki50 Sep 16, 2017
5e0b43c
add changelog entry about removed methods
zaki50 Sep 16, 2017
a3e2407
remove unused code
zaki50 Sep 16, 2017
b7d0167
update comment
zaki50 Sep 16, 2017
f27b2a2
remove comment
zaki50 Sep 16, 2017
e9e960d
update exception message
zaki50 Sep 18, 2017
4acc4a2
update thrown.expectMessage() to check exception message
zaki50 Sep 18, 2017
676a11b
fix test case name
zaki50 Sep 18, 2017
b33bb8e
add assertion for remove/removeAll
zaki50 Sep 18, 2017
b7b59bd
update RealmList.toString()
zaki50 Sep 18, 2017
a12c0c3
update exception message
zaki50 Sep 18, 2017
88ed4ba
fix failing tests
zaki50 Sep 18, 2017
06d562d
remove special handling to byte array in RealmList
zaki50 Sep 18, 2017
40b1ac2
remove special type conversion via Number in toArray()
zaki50 Sep 18, 2017
5817352
Merge branch 'my/primitive_list_9_RealmList' into mc/primitive_list_1…
zaki50 Sep 18, 2017
4ff447d
fix failing tests
zaki50 Sep 18, 2017
2fee5f7
Merge branch 'my/primitive_list_9_RealmList' into my/primitive_list_1…
zaki50 Sep 18, 2017
90affd1
remove unnecessary index checks
zaki50 Sep 18, 2017
38bd2bc
refactor ManagedListOperator and its sub-classes
zaki50 Sep 19, 2017
c871e8a
use thrown.expectMessage()
zaki50 Sep 19, 2017
93a4037
add Javadoc comments to ManagedListOperator and its subclasses
zaki50 Sep 19, 2017
31eca1c
Merge branch 'master' into feature/primitive_list
zaki50 Sep 19, 2017
e4de8b3
Merge branch 'feature/primitive_list' into my/primitive_list_9_RealmList
zaki50 Sep 19, 2017
d798e2d
Merge branch 'my/primitive_list_9_RealmList' into mc/primitive_list_1…
zaki50 Sep 19, 2017
3f496e2
Merge branch 'my/primitive_list_9_RealmList' into my/primitive_list_1…
zaki50 Sep 19, 2017
c50e0a3
address review comments
zaki50 Sep 19, 2017
a1f3d7b
Merge branch 'my/primitive_list_9_RealmList' into mc/primitive_list_1…
zaki50 Sep 19, 2017
748f8f0
Merge branch 'my/primitive_list_9_RealmList' into my/primitive_list_1…
zaki50 Sep 19, 2017
4c63804
Primitive List feature(Part 9, RealmList) (#5213)
zaki50 Sep 19, 2017
9b691ac
Merge branch 'feature/primitive_list' into mc/primitive_list_13_Liste…
zaki50 Sep 19, 2017
41e78b8
Merge branch 'feature/primitive_list' into my/primitive_list_14_fix_s…
zaki50 Sep 19, 2017
30f57f9
Merge pull request #5266 from realm/my/primitive_list_14_fix_shared_p…
zaki50 Sep 19, 2017
e0bb50c
Merge pull request #5259 from realm/mc/primitive_list_13_Listener_on_…
zaki50 Sep 19, 2017
7187807
Merge branch 'master' into feature/primitive_list
cmelchior Sep 26, 2017
9e287d4
fix intentation
zaki50 Sep 26, 2017
a8c2a22
Merge branch 'master' into cm/cm/primitivelist-schema-support
cmelchior Sep 26, 2017
e306e08
Merge branch 'master' into feature/primitive_list
cmelchior Sep 26, 2017
51c5192
Merge branch 'feature/primitive_list' into cm/cm/primitivelist-schema…
cmelchior Sep 26, 2017
0f5ef60
Add preliminary support for adding primitive lists.
cmelchior Sep 26, 2017
b56a46c
Add JNI support for switching between nullable and non-nullable.
cmelchior Sep 26, 2017
d431a73
Fix bugs in implementation and tests
cmelchior Sep 27, 2017
54fdd63
Fix column indices
cmelchior Sep 28, 2017
ee2dacc
Add test for changing existing data
cmelchior Sep 28, 2017
995a3b5
Add tests for primary key and indexed fields
cmelchior Sep 28, 2017
b7f0650
Add changelog
cmelchior Sep 28, 2017
87b2852
Fix findbugs
cmelchior Sep 28, 2017
2cd1e3e
Primitive List feature(Part15: Disable RealmList.createSnapshot() whe…
zaki50 Sep 29, 2017
068fbce
Merge branch 'master' into feature/primitive_list
cmelchior Oct 1, 2017
efa3315
Fix unit test
cmelchior Oct 1, 2017
b012689
Merge branch 'feature/primitive_list' into cm/cm/primitivelist-schema…
cmelchior Oct 1, 2017
b91cb98
PR feedback
cmelchior Oct 1, 2017
787408e
More cleanup
cmelchior Oct 1, 2017
deb9dde
Merge branch 'master' into cm/cm/primitivelist-schema-support
cmelchior Oct 1, 2017
a320044
Fix wrong var name
cmelchior Oct 1, 2017
97d35b5
Merge branch 'master' into cm/cm/primitivelist-schema-support
cmelchior Oct 1, 2017
686716b
Remove types no longer visible
cmelchior Oct 1, 2017
45bf86a
Change class type parameter for better readability
cmelchior Oct 2, 2017
a25e747
Better javadoc
cmelchior Oct 2, 2017
5a02165
PR feedback
cmelchior Oct 2, 2017
a479f31
Ups
cmelchior Oct 2, 2017
14d0679
Fix unit test
cmelchior Oct 2, 2017
3fa8e2e
DynamicRealm support for arrays of primitives (#5351)
cmelchior Oct 3, 2017
ca9217c
Rename variables to primitiveType. Better error messages for wrong Cl…
cmelchior Oct 3, 2017
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

## Enhancements

* Added support for primitive lists in migrations using `RealmObjectSchema.addRealmListField(String name, Class<?> type)` (#5329).
* Now users can use `String`, `byte[]`, `Boolean`, `Long`, `Integer`, `Short`, `Byte`, `Double`, `Float` and `Date` as a type parameter of `RealmList`.

## Bug Fixes
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

475 changes: 275 additions & 200 deletions realm/realm-library/src/main/cpp/io_realm_internal_Table.cpp

Large diffs are not rendered by default.

233 changes: 186 additions & 47 deletions realm/realm-library/src/main/java/io/realm/DynamicRealmObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.Locale;

import javax.annotation.Nonnull;
Expand Down Expand Up @@ -336,6 +337,8 @@ public DynamicRealmObject getObject(String fieldName) {

/**
* Returns the {@link RealmList} of {@link DynamicRealmObject}s being linked from the given field.
* <p>
* If the list contains primitive types, use {@link #getList(String, Class)} instead.
*
* @param fieldName the name of the field.
* @return the {@link RealmList} data for this field.
Expand All @@ -346,7 +349,7 @@ public RealmList<DynamicRealmObject> getList(String fieldName) {

long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName);
try {
OsList osList = proxyState.getRow$realm().getList(columnIndex);
OsList osList = proxyState.getRow$realm().getModelList(columnIndex);
//noinspection ConstantConditions
@Nonnull
String className = osList.getTargetTable().getClassName();
Expand All @@ -358,15 +361,54 @@ public RealmList<DynamicRealmObject> getList(String fieldName) {
}

/**
* Returns the {@link RealmList} of values being linked from the given field.
* Returns the {@link RealmList} containing only primitive values.
*
* <p>
* If the list contains references to other Realm objects, use {@link #getList(String)} instead.
*
* @param fieldName the name of the field.
* @param primitiveType the type of elements in the list. Only primitive types are supported.
* @return the {@link RealmList} data for this field.
* @throws IllegalArgumentException if field name doesn't exist or it doesn't contain a list of values.
* @throws IllegalArgumentException if field name doesn't exist or it doesn't contain a list of primitive objects.
*/
public <T> RealmList<T> getValueList(String fieldName, Class<T> valueClass) {
// TODO implement this
return null;
public <E> RealmList<E> getList(String fieldName, Class<E> primitiveType) {
proxyState.getRealm$realm().checkIfValid();

if (primitiveType == null) {
throw new IllegalArgumentException("Non-null 'primitiveType' required.");
}
long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName);
RealmFieldType realmType = classToRealmType(primitiveType);
try {
OsList osList = proxyState.getRow$realm().getValueList(columnIndex, realmType);
return new RealmList<>(primitiveType, osList, proxyState.getRealm$realm());
} catch (IllegalArgumentException e) {
checkFieldType(fieldName, columnIndex, realmType);
throw e;
}
}

private <E> RealmFieldType classToRealmType(Class<E> primitiveType) {
if (primitiveType.equals(Integer.class)
|| primitiveType.equals(Long.class)
|| primitiveType.equals(Short.class)
|| primitiveType.equals(Byte.class)) {
return RealmFieldType.INTEGER_LIST;
} else if (primitiveType.equals(Boolean.class)) {
return RealmFieldType.BOOLEAN_LIST;
} else if (primitiveType.equals(String.class)) {
return RealmFieldType.STRING_LIST;
} else if (primitiveType.equals(byte[].class)) {
return RealmFieldType.BINARY_LIST;
} else if (primitiveType.equals(Date.class)) {
return RealmFieldType.DATE_LIST;
} else if (primitiveType.equals(Float.class)) {
return RealmFieldType.FLOAT_LIST;
} else if (primitiveType.equals(Double.class)) {
return RealmFieldType.DOUBLE_LIST;
} else {
throw new IllegalArgumentException("Unsupported element type. Only primitive types supported. Yours was: " + primitiveType);
}
}

/**
Expand All @@ -393,6 +435,15 @@ public boolean isNull(String fieldName) {
case DATE:
return proxyState.getRow$realm().isNull(columnIndex);
case LIST:
case LINKING_OBJECTS:
case INTEGER_LIST:
case BOOLEAN_LIST:
case STRING_LIST:
case BINARY_LIST:
case DATE_LIST:
case FLOAT_LIST:
case DOUBLE_LIST:
// fall through
default:
return false;
}
Expand Down Expand Up @@ -510,28 +561,7 @@ private void setValue(String fieldName, Object value) {
setObject(fieldName, (DynamicRealmObject) value);
} else if (valueClass == RealmList.class) {
RealmList<?> list = (RealmList<?>) value;
if (list.className == null && list.clazz == null) {
// unmanaged RealmList
long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName);
final RealmFieldType columnType = proxyState.getRow$realm().getColumnType(columnIndex);
if (columnType == RealmFieldType.LIST) {
//noinspection unchecked
for (Object element : list) {
if (!(element instanceof RealmModel)) {
throw new IllegalArgumentException("All elements in the list must be an instance of RealmModel.");
}
}
//noinspection unchecked
setList(fieldName, (RealmList<DynamicRealmObject>) list);
} else {
setValueList(fieldName, list);
}
} else if (list.className != null || RealmModel.class.isAssignableFrom(list.clazz)) {
//noinspection unchecked
setList(fieldName, (RealmList<DynamicRealmObject>) list);
} else {
setValueList(fieldName, list);
}
setList(fieldName, list);
} else {
throw new IllegalArgumentException("Value is of an type not supported: " + value.getClass());
}
Expand Down Expand Up @@ -727,21 +757,54 @@ public void setObject(String fieldName, @Nullable DynamicRealmObject value) {
* Sets the reference to a {@link RealmList} on the given field.
*
* @param fieldName field name.
* @param list list of references.
* @throws IllegalArgumentException if field name doesn't exist, it is not a list field, the type
* of the object represented by the DynamicRealmObject doesn't match or any element in the list belongs to a
* different Realm.
* @param list list of objects. Must either be primitive types or {@link DynamicRealmObject}s.
* @throws IllegalArgumentException if field name doesn't exist, it is not a list field, the objects in the
* list doesn't match the expected type or any Realm object in the list belongs to a different Realm.
*/
public void setList(String fieldName, RealmList<DynamicRealmObject> list) {
public <E> void setList(String fieldName, RealmList<E> list) {
proxyState.getRealm$realm().checkIfValid();

//noinspection ConstantConditions
if (list == null) {
throw new IllegalArgumentException("Null values not allowed for lists");
throw new IllegalArgumentException("Non-null 'list' required");
}

// Find type of list in Realm
long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName);
final RealmFieldType columnType = proxyState.getRow$realm().getColumnType(columnIndex);

switch (columnType) {
case LIST:
// Due to type erasure it is not possible to check the generic parameter,
// instead we try to see if the first element is of the wrong type in order
// to throw a better error message.
// Primitive types are checked inside `setModelList`
if (!list.isEmpty()) {
E element = list.first();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just catching the possible ClassCastException and re-throwing it with the custom message would be more reliable and less hacky.

I like the message though!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The classcast exception would not catch the generic parameter, only if RealmList was of the wrong type. Type erasure is a pain :(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I guess it'll do. Thank you! 🙂

if (!(element instanceof DynamicRealmObject) && RealmModel.class.isAssignableFrom(element.getClass())) {
throw new IllegalArgumentException("RealmList must contain `DynamicRealmObject's, not Java model classes.");
}
}
//noinspection unchecked
setModelList(fieldName, (RealmList<DynamicRealmObject>) list);
break;
case INTEGER_LIST:
case BOOLEAN_LIST:
case STRING_LIST:
case BINARY_LIST:
case DATE_LIST:
case FLOAT_LIST:
case DOUBLE_LIST:
setValueList(fieldName, list, columnType);
break;
default:
throw new IllegalArgumentException(String.format("Field '%s' is not a list but a %s", fieldName, columnType));
}
}

private void setModelList(String fieldName, RealmList<DynamicRealmObject> list) {
long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName);
OsList osList = proxyState.getRow$realm().getList(columnIndex);
OsList osList = proxyState.getRow$realm().getModelList(columnIndex);
Table linkTargetTable = osList.getTargetTable();
//noinspection ConstantConditions
@Nonnull
Expand Down Expand Up @@ -788,17 +851,72 @@ public void setList(String fieldName, RealmList<DynamicRealmObject> list) {
}
}

/**
* Sets the reference to a {@link RealmList} on the given field.
*
* @param fieldName field name.
* @param list list of references.
* @throws IllegalArgumentException if field name doesn't exist, it is not a list field, the type
* of the object represented by the DynamicRealmObject doesn't match or any element in the list belongs to a
* different Realm.
*/
public void setValueList(String fieldName, RealmList<?> list) {
// TODO implement this
@SuppressWarnings("unchecked")
private <E> void setValueList(String fieldName, RealmList<E> list, RealmFieldType primitiveType) {
long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName);
OsList osList = proxyState.getRow$realm().getValueList(columnIndex, primitiveType);

Class<E> elementClass;
switch(primitiveType) {
case INTEGER_LIST: elementClass = (Class<E>) Long.class; break;
case BOOLEAN_LIST: elementClass = (Class<E>) Boolean.class; break;
case STRING_LIST: elementClass = (Class<E>) String.class; break;
case BINARY_LIST: elementClass = (Class<E>) byte[].class; break;
case DATE_LIST: elementClass = (Class<E>) Date.class; break;
case FLOAT_LIST: elementClass = (Class<E>) Float.class; break;
case DOUBLE_LIST: elementClass = (Class<E>) Double.class; break;
default:
throw new IllegalArgumentException("Unsupported type: " + primitiveType);
}
final ManagedListOperator<?> operator = getOperator(proxyState.getRealm$realm(), osList, primitiveType, elementClass);

if (list.isManaged() && osList.size() == list.size()) {
// There is a chance that the source list and the target list are the same list in the same object.
// In this case, we can't use removeAll().
final int size = list.size();
final Iterator<?> iterator = list.iterator();
for (int i = 0; i < size; i++) {
@Nullable
final Object value = iterator.next();
operator.set(i, value);
}
} else {
osList.removeAll();
for (Object value : list) {
operator.append(value);
}
}
}

private <E> ManagedListOperator<E> getOperator(BaseRealm realm, OsList osList, RealmFieldType valueListType, Class<E> valueClass) {
if (valueListType == RealmFieldType.STRING_LIST) {
//noinspection unchecked
return (ManagedListOperator<E>) new StringListOperator(realm, osList, (Class<String>) valueClass);
}
if (valueListType == RealmFieldType.INTEGER_LIST) {
return new LongListOperator<>(realm, osList, valueClass);
}
if (valueListType == RealmFieldType.BOOLEAN_LIST) {
//noinspection unchecked
return (ManagedListOperator<E>) new BooleanListOperator(realm, osList, (Class<Boolean>) valueClass);
}
if (valueListType == RealmFieldType.BINARY_LIST) {
//noinspection unchecked
return (ManagedListOperator<E>) new BinaryListOperator(realm, osList, (Class<byte[]>) valueClass);
}
if (valueListType == RealmFieldType.DOUBLE_LIST) {
//noinspection unchecked
return (ManagedListOperator<E>) new DoubleListOperator(realm, osList, (Class<Double>) valueClass);
}
if (valueListType == RealmFieldType.FLOAT_LIST) {
//noinspection unchecked
return (ManagedListOperator<E>) new FloatListOperator(realm, osList, (Class<Float>) valueClass);
}
if (valueListType == RealmFieldType.DATE_LIST) {
//noinspection unchecked
return (ManagedListOperator<E>) new DateListOperator(realm, osList, (Class<Date>) valueClass);
}
throw new IllegalArgumentException("Unexpected list type: " + valueListType.name());
}

/**
Expand Down Expand Up @@ -964,7 +1082,28 @@ public String toString() {
break;
case LIST:
String targetClassName = proxyState.getRow$realm().getTable().getLinkTarget(columnIndex).getClassName();
sb.append(String.format(Locale.US, "RealmList<%s>[%s]", targetClassName, proxyState.getRow$realm().getList(columnIndex).size()));
sb.append(String.format(Locale.US, "RealmList<%s>[%s]", targetClassName, proxyState.getRow$realm().getModelList(columnIndex).size()));
break;
case INTEGER_LIST:
sb.append(String.format(Locale.US, "RealmList<Long>[%s]", proxyState.getRow$realm().getValueList(columnIndex, type).size()));
break;
case BOOLEAN_LIST:
sb.append(String.format(Locale.US, "RealmList<Boolean>[%s]", proxyState.getRow$realm().getValueList(columnIndex, type).size()));
break;
case STRING_LIST:
sb.append(String.format(Locale.US, "RealmList<String>[%s]", proxyState.getRow$realm().getValueList(columnIndex, type).size()));
break;
case BINARY_LIST:
sb.append(String.format(Locale.US, "RealmList<byte[]>[%s]", proxyState.getRow$realm().getValueList(columnIndex, type).size()));
break;
case DATE_LIST:
sb.append(String.format(Locale.US, "RealmList<Date>[%s]", proxyState.getRow$realm().getValueList(columnIndex, type).size()));
break;
case FLOAT_LIST:
sb.append(String.format(Locale.US, "RealmList<Float>[%s]", proxyState.getRow$realm().getValueList(columnIndex, type).size()));
break;
case DOUBLE_LIST:
sb.append(String.format(Locale.US, "RealmList<Double>[%s]", proxyState.getRow$realm().getValueList(columnIndex, type).size()));
break;
default:
sb.append("?");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public RealmObjectSchema addRealmListField(String fieldName, RealmObjectSchema o
throw new UnsupportedOperationException(SCHEMA_IMMUTABLE_EXCEPTION_MSG);
}

@Override
public RealmObjectSchema addRealmListField(String fieldName, Class<?> primitiveType) {
throw new UnsupportedOperationException(SCHEMA_IMMUTABLE_EXCEPTION_MSG);
}

@Override
public RealmObjectSchema removeField(String fieldName) {
throw new UnsupportedOperationException(SCHEMA_IMMUTABLE_EXCEPTION_MSG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.Locale;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import io.realm.internal.OsObjectStore;
import io.realm.internal.Table;
Expand Down Expand Up @@ -105,7 +104,7 @@ public RealmObjectSchema addField(String fieldName, Class<?> fieldType, FieldAtt
nullable = false;
}

long columnIndex = table.addColumn(metadata.realmType, fieldName, nullable);
long columnIndex = table.addColumn(metadata.fieldType, fieldName, nullable);
try {
addModifiers(fieldName, attributes);
} catch (Exception e) {
Expand All @@ -132,6 +131,25 @@ public RealmObjectSchema addRealmListField(String fieldName, RealmObjectSchema o
return this;
}

@Override
public RealmObjectSchema addRealmListField(String fieldName, Class<?> primitiveType) {
checkLegalName(fieldName);
checkFieldNameIsAvailable(fieldName);

FieldMetaData metadata = SUPPORTED_SIMPLE_FIELDS.get(primitiveType);
if (metadata == null) {
if (primitiveType.equals(RealmObjectSchema.class) || RealmModel.class.isAssignableFrom(primitiveType)) {
throw new IllegalArgumentException("Use 'addRealmListField(String name, RealmObjectSchema schema)' instead to add lists that link to other RealmObjects: " + fieldName);
} else {
throw new IllegalArgumentException(String.format(Locale.US,
"RealmList does not support lists with this type: %s(%s)",
fieldName, primitiveType));
}
}
table.addColumn(metadata.listType, fieldName, metadata.defaultNullable);
return this;
}

@Override
public RealmObjectSchema removeField(String fieldName) {
realm.checkNotInSync(); // destructive modification of a schema is not permitted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public RealmObjectSchema createWithPrimaryKeyField(String className, String prim
String internalTableName = checkAndGetTableNameFromClassName(className);

RealmObjectSchema.FieldMetaData metadata = RealmObjectSchema.getSupportedSimpleFields().get(fieldType);
if (metadata == null || (metadata.realmType != RealmFieldType.STRING &&
metadata.realmType != RealmFieldType.INTEGER)) {
if (metadata == null || (metadata.fieldType != RealmFieldType.STRING &&
metadata.fieldType != RealmFieldType.INTEGER)) {
throw new IllegalArgumentException(String.format("Realm doesn't support primary key field type '%s'.",
fieldType));
}
boolean isStringField = (metadata.realmType == RealmFieldType.STRING);
boolean isStringField = (metadata.fieldType == RealmFieldType.STRING);

boolean nullable = metadata.defaultNullable;
if (MutableRealmObjectSchema.containsAttribute(attributes, FieldAttribute.REQUIRED)) {
Expand Down
2 changes: 1 addition & 1 deletion realm/realm-library/src/main/java/io/realm/RealmList.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class RealmList<E> extends AbstractList<E> implements OrderedRealmCollect
protected String className;

// Always null if RealmList is unmanaged, always non-null if managed.
private final ManagedListOperator<E> osListOperator;
final ManagedListOperator<E> osListOperator;
final protected BaseRealm realm;
private List<E> unmanagedList;
// Used for listeners on RealmList<RealmModel>
Expand Down
Loading