Source:
<code>public boolean publish(Collection collection, Session session, boolean breakBeforePublish, boolean skipVerification) throws IOException, UnauthorizedException, BadRequestException, ConflictException, NotFoundException { if (collection == null) { throw new BadRequestException("Please provide a valid collection."); } if (session == null || !zebedeeCmsService.getPermissions().canEdit(session.getEmail())) { throw new UnauthorizedException(getUnauthorizedMessage(session)); } <START> if (collection.description.approvalStatus != ApprovalStatus.COMPLETE) { <END> throw new ConflictException("This collection cannot be published because it is not approved"); } if (breakBeforePublish) { logInfo("Breaking before publish").log(); return true; } logInfo("Going ahead with publish").log(); Keyring keyring = zebedeeCmsService.getZebedee().getKeyringCache().get(session); if (keyring == null) throw new UnauthorizedException("No keyring is available for " + session.getEmail()); ZebedeeCollectionReader collectionReader = new ZebedeeCollectionReader(zebedeeCmsService.getZebedee(), collection, session); long publishStart = System.currentTimeMillis(); boolean publishComplete = zebedeeCmsService.getPublisher().DoFullPublish(collection, session.getEmail(), collectionReader); if (publishComplete) { long onPublishCompleteStart = System.currentTimeMillis(); new PublishNotification(collection).sendNotification(EventType.PUBLISHED); PostPublisher.postPublish(zebedeeCmsService.getZebedee(), collection, skipVerification, collectionReader); logInfo("Collection postPublish process finished") .collectionName(collection) .timeTaken((System.currentTimeMillis() - onPublishCompleteStart)) .log(); logInfo("Collection publish complete.") .collectionName(collection) .timeTaken((System.currentTimeMillis() - publishStart)) .log(); } return publishComplete; }</code><technical_language>if collection.getDescription() instead? I phase out public class memebers I can</technical_language>

Target:
private boolean publish(Collection collection, Session session, boolean breakBeforePublish, boolean skipVerification) throws IOException, UnauthorizedException, BadRequestException, ConflictException, NotFoundException { if (collection == null) { throw new BadRequestException("Please provide a valid collection."); } if (session == null || !zebedeeCmsService.getPermissions().canEdit(session.getEmail())) { throw new UnauthorizedException(getUnauthorizedMessage(session)); } if (collection.getDescription().approvalStatus != ApprovalStatus.COMPLETE) { throw new ConflictException("This collection cannot be published because it is not approved"); } if (breakBeforePublish) { logInfo("Breaking before publish").log(); return true; } logInfo("Going ahead with publish").log(); Keyring keyring = zebedeeCmsService.getZebedee().getKeyringCache().get(session); if (keyring == null) { UnauthorizedException ex = new UnauthorizedException("no keyring is available for " + session.getEmail()); logError(ex).user(session.getEmail()).log(); throw ex; } ZebedeeCollectionReader collectionReader = new ZebedeeCollectionReader(zebedeeCmsService.getZebedee(), collection, session); long publishStart = System.currentTimeMillis(); boolean publishComplete = zebedeeCmsService.getPublisher().DoFullPublish(collection, session.getEmail(), collectionReader); if (publishComplete) { long onPublishCompleteStart = System.currentTimeMillis(); new PublishNotification(collection).sendNotification(EventType.PUBLISHED); PostPublisher.postPublish(zebedeeCmsService.getZebedee(), collection, skipVerification, collectionReader); logInfo("Collection postPublish process finished") .collectionName(collection) .timeTaken((System.currentTimeMillis() - onPublishCompleteStart)) .log(); logInfo("Collection publish complete.") .collectionName(collection) .timeTaken((System.currentTimeMillis() - publishStart)) .log(); } else { logDebug("publish is not complete. skipping post publish").collectionName(collection).log(); } return publishComplete; }