> + @Override > + public String execute(String container, Blob blob) { > + > + ObjectTemplate destination = > blob2ObjectTemplate.apply(blob.getMetadata()); > + ComposeObjectTemplate template = new > ComposeObjectTemplate().destination(destination); > + > + Set<GCSObject> sourceList = Sets.newHashSet(); > + > + String key = blob.getMetadata().getName(); > + Payload payload = blob.getPayload(); > + Long length = payload.getContentMetadata().getContentLength(); > + if (length == null) { > + length = blob.getMetadata().getContentMetadata().getContentLength(); > + payload.getContentMetadata().setContentLength(length); > + } > + checkNotNull(length,
Hoist the precondition closer to the method beginning? This will allow you to simplify the logic: ``` long length = checkNotNull(length, "please invoke payload.getContentMetadata().setContentLength(length) prior to multipart upload"); payload.getContentMetadata().setContentLength(length); ``` --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-google/pull/48/files#r17210197