> +         BucketTemplateInternal template = new BucketTemplateInternal(src);
> +         JsonObject bucketTemplate = (JsonObject) 
> context.serialize(template, BucketTemplateInternal.class);
> +
> +         // deal with bucketAccessControls
> +         if (!(src.getAcl() == null) && (src.getAcl().isEmpty())) {
> +            bucketTemplate.add("acl", null);
> +         }
> +         // deal with DefaultObjectAccessControls
> +         if (!(src.getDefaultObjectAccessControls() == null) && 
> (src.getDefaultObjectAccessControls().isEmpty())) {
> +            bucketTemplate.add("defaultObjectAccessControls", null);
> +         }
> +
> +         // deal with Cors
> +         if (!(src.getCors() == null) && (src.getCors().isEmpty())) {
> +            bucketTemplate.add("cors", null);
> +         }

This is to avoid  appending empty sets to  to request  like acl = [ ] .  cors = 
[ ] .
 It only test for  !(src.getCors() == null)  to  avoid NullPointer (even though 
being null is unlikey)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/33/files#r14645536

Reply via email to