realm-java
realm-java copied to clipboard
Align PrimaryKey related exceptions
When createObject(Class,Object)
is called and the Class
does not have any primary key, it throws IllegalStateException
.
On the other hand, if createObject(Class)
is called and the Class
has a primary key, it throws RealmException
.
Typed RealmObject
throws RealmException
but DynamicRealmObject
throws IllegalArgumentException
when setter is called a against primary key.
Shouldn’t we align the exception about primary key?
Current conclusion of our internal discussion is that we will align them to RealmException
.