Source:
public DocumentRevision update(final DocumentRevision rev) throws AttachmentException, DocumentNotFoundException, ConflictException, DocumentStoreException { Misc.checkNotNull(rev, "DocumentRevision"); Misc.checkState(isOpen(), "Datastore is closed"); Misc.checkArgument(rev.isFullRevision(), "Projected revisions cannot be used to " + "create documents"); if (rev.getId().startsWith(CouchConstants._local_prefix)) { throw new IllegalArgumentException("Use create(final DocumentRevision rev) create or update local documents"); } if (rev.isDeleted()) { return delete(rev); } Map<String, Attachment> attachments = rev.getAttachments() != null ? rev.getAttachments() : new HashMap<String, Attachment>(); final Map<String, PreparedAttachment> preparedNewAttachments = AttachmentManager.prepareAttachments(attachmentsDir, attachmentStreamFactory, AttachmentManager.findNewAttachments(attachments)); final Map<String, SavedAttachment> existingAttachments = AttachmentManager.findExistingAttachments(attachments); try { InternalDocumentRevision revision = get(queue.submitTransaction(new UpdateDocumentFromRevisionCallable( rev, preparedNewAttachments, existingAttachments, this.attachmentsDir, this.attachmentStreamFactory))); if (revision != null) { try { eventBus.post(new DocumentUpdated(read(rev.getId(), rev.getRevision()), revision)); } catch (DocumentStoreException de) { ; } catch (DocumentException de) { ; } } return revision; } catch (ExecutionException e) { throwCauseAs(e, InvalidDocumentException.class); throwCauseAs(e, ConflictException.class); throwCauseAs(e, DocumentNotFoundException.class); String message = "Failed to update document"; logger.log(Level.SEVERE, message, e); throw new DocumentStoreException(message, e.getCause()); } }

Target:
public DocumentRevision update(final DocumentRevision rev) throws AttachmentException, DocumentNotFoundException, ConflictException, DocumentStoreException { Misc.checkNotNull(rev, "DocumentRevision"); Misc.checkState(isOpen(), "Datastore is closed"); Misc.checkArgument(rev.isFullRevision(), "Projected revisions cannot be used to " + "create documents"); if (rev.getId().startsWith(CouchConstants._local_prefix)) { return create(rev); } if (rev.isDeleted()) { return delete(rev); } Map<String, Attachment> attachments = rev.getAttachments() != null ? rev.getAttachments() : new HashMap<String, Attachment>(); final Map<String, PreparedAttachment> preparedNewAttachments = AttachmentManager.prepareAttachments(attachmentsDir, attachmentStreamFactory, AttachmentManager.findNewAttachments(attachments)); final Map<String, SavedAttachment> existingAttachments = AttachmentManager.findExistingAttachments(attachments); try { InternalDocumentRevision revision = get(queue.submitTransaction(new UpdateDocumentFromRevisionCallable( rev, preparedNewAttachments, existingAttachments, this.attachmentsDir, this.attachmentStreamFactory))); if (revision != null) { try { eventBus.post(new DocumentUpdated(read(rev.getId(), rev.getRevision()), revision)); } catch (DocumentStoreException de) { ; } catch (DocumentException de) { ; } } return revision; } catch (ExecutionException e) { throwCauseAs(e, InvalidDocumentException.class); throwCauseAs(e, ConflictException.class); throwCauseAs(e, DocumentNotFoundException.class); String message = "Failed to update document"; logger.log(Level.SEVERE, message, e); throw new DocumentStoreException(message, e.getCause()); } }