Source:
<code>public Document getDocumentById( String id ) { File file = fileFor(id); if (isExcluded(file) || !file.exists()) { return null; <START> } <END> boolean isRoot = isRoot(id); boolean isResource = isContentNode(id); DocumentWriter writer = null; File parentFile = file.getParentFile(); if (isResource) { writer = newDocument(id); BinaryValue binaryValue = binaryFor(file); writer.setPrimaryType(NT_RESOURCE); writer.addProperty(JCR_DATA, binaryValue); if (addMimeTypeMixin) { String mimeType = null; String encoding = null; try { mimeType = binaryValue.getMimeType(); } catch (Throwable e) { getLogger().error(e, JcrI18n.couldNotGetMimeType, getSourceName(), id, e.getMessage()); } writer.addProperty(JCR_ENCODING, encoding); writer.addProperty(JCR_MIME_TYPE, mimeType); } writer.addProperty(JCR_LAST_MODIFIED, factories().getDateFactory().create(file.lastModified())); writer.addProperty(JCR_LAST_MODIFIED_BY, null); writer.setNotQueryable(); parentFile = file; } else if (file.isFile()) { writer = newDocument(id); writer.setPrimaryType(NT_FILE); writer.addProperty(JCR_CREATED, factories().getDateFactory().create(file.lastModified())); writer.addProperty(JCR_CREATED_BY, null); String childId = isRoot ? JCR_CONTENT_SUFFIX : id + JCR_CONTENT_SUFFIX; writer.addChild(childId, JCR_CONTENT); } else { writer = newFolderWriter(id, file, 0); } if (!isRoot) { String parentId = idFor(parentFile); writer.setParents(parentId); } writer.addProperties(extraPropertiesStore().getProperties(id)); if (addMimeTypeMixin) { writer.addMixinType(MIX_MIME_TYPE); } return writer.document(); }</code><technical_language>of single-line if-blocks reformatted block-style. Is intentional? I tend small, single-line if-blocks else's</technical_language>

Target:
public Document getDocumentById( String id ) { File file = fileFor(id); if (isExcluded(file) || !file.exists()) return null; boolean isRoot = isRoot(id); boolean isResource = isContentNode(id); DocumentWriter writer = null; File parentFile = file.getParentFile(); if (isResource) { writer = newDocument(id); BinaryValue binaryValue = binaryFor(file); writer.setPrimaryType(NT_RESOURCE); writer.addProperty(JCR_DATA, binaryValue); if (addMimeTypeMixin) { String mimeType = null; String encoding = null; try { mimeType = binaryValue.getMimeType(); } catch (Throwable e) { getLogger().error(e, JcrI18n.couldNotGetMimeType, getSourceName(), id, e.getMessage()); } writer.addProperty(JCR_ENCODING, encoding); writer.addProperty(JCR_MIME_TYPE, mimeType); } writer.addProperty(JCR_LAST_MODIFIED, factories().getDateFactory().create(file.lastModified())); writer.addProperty(JCR_LAST_MODIFIED_BY, null); writer.setNotQueryable(); parentFile = file; } else if (file.isFile()) { writer = newDocument(id); writer.setPrimaryType(NT_FILE); writer.addProperty(JCR_CREATED, factories().getDateFactory().create(file.lastModified())); writer.addProperty(JCR_CREATED_BY, null); String childId = isRoot ? JCR_CONTENT_SUFFIX : id + JCR_CONTENT_SUFFIX; writer.addChild(childId, JCR_CONTENT); } else { writer = newFolderWriter(id, file, 0); } if (!isRoot) { String parentId = idFor(parentFile); writer.setParents(parentId); } writer.addProperties(extraPropertiesStore().getProperties(id)); if (addMimeTypeMixin) { writer.addMixinType(MIX_MIME_TYPE); } return writer.document(); }