Source:
<code>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)) { <START> throw new IllegalArgumentException("Use create(final DocumentRevision rev) create or update local documents"); <END> } 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()); } }</code><technical_language>I call create resulting application code easier understand for users e.g. if paths for initial local doc update confusing written create if underlying effect is same</technical_language>

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()); } }