In sync-android v2.0.0, when calling getAttachments() on a deleted revision, a ClassCastException is thrown:
java.lang.ClassCastException: java.util.HashMap cannot be cast to com.cloudant.sync.internal.common.ChangeNotifyingMap
Although one shouldn't be able to access attachments on a deleted revision, it would be much nicer if this returned null or an empty Map or a more appropriate exception.
java.lang.ClassCastException: java.util.HashMap cannot be cast to com.cloudant.sync.internal.common.ChangeNotifyingMap
at com.cloudant.sync.internal.documentstore.InternalDocumentRevision.getAttachments(InternalDocumentRevision.java:214)
at com.cloudant.sync.internal.documentstore.InternalDocumentRevision.getAttachments(InternalDocumentRevision.java:32)
...
In sync-android v2.0.0, when calling
getAttachments()
on a deleted revision, a ClassCastException is thrown:Although one shouldn't be able to access attachments on a deleted revision, it would be much nicer if this returned
null
or an emptyMap
or a more appropriate exception.A simple example demonstrating this issue is:
Relevant stack trace: