> @@ -321,6 +341,24 @@ public CreateServerOptions 
> securityGroupNames(Iterable<String> securityGroupName
>        return this;
>     }
>     
> +   /**
> +    * 
> +    * @see #getNetworks
> +    */
> +   public CreateServerOptions networks(String... networks) {
> +      return networks(ImmutableSet.copyOf(checkNotNull(networks, "network 
> should not be empty")));
> +   }
> +
> +   /**
> +    * @see #getNetworks
> +    */
> +   public CreateServerOptions networks(Iterable<String> networks) {
> +      for (String network : checkNotNull(networks, "networks"))
> +         checkNotNull(emptyToNull(network), "all networks must be 
> non-empty");

Checking for `null` doesn't seem to match with the error message. For the 
non-empty check, we can use the 
[`ImmutableSet.Builder`](http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableSet.Builder.html#add\(E\)):
```
ImmutableSet.Builder builder = ImmutableSet.builder();
for (String network : checkNotNull(networks, "networks")) {
  builder.add(emptyToNull(network)); // will NPE if network is null
}
this.networks = builder.build();
return this
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/72/files#r5386864

Reply via email to