> +                                   BlockUntilJobCompletesAndReturnResult 
> blockUntilJobCompletesAndReturnResult,
> +                                   Predicate<String> jobComplete) {
> +      this.client = checkNotNull(client, "client");
> +      this.userExecutor = checkNotNull(userExecutor, "userExecutor");
> +      this.locations = checkNotNull(locations, "locations");
> +      this.imageAvailablePredicate = checkNotNull(imageAvailablePredicate, 
> "imageAvailablePredicate");
> +      this.blockUntilJobCompletesAndReturnResult = 
> checkNotNull(blockUntilJobCompletesAndReturnResult,
> +                                                                
> "blockUntilJobCompletesAndReturnResult");
> +      this.jobComplete = checkNotNull(jobComplete, "jobComplete");
> +   }
> +
> +   @Override
> +   public ImageTemplate buildImageTemplateFromNode(String name, final String 
> id) {
> +      VirtualMachine vm = 
> client.getVirtualMachineClient().getVirtualMachine(id);
> +      if (vm == null)
> +         throw new NoSuchElementException("Cannot find vm with id: " + id);

Do we need `NoSuchElementException` here? If not, could `checkState` or 
`checkArgument` or so be used to shorten this, e.g.
```
VirtualMachine vm = 
checkNotNull(client.getVirtualMachineClient().getVirtualMachine(id), ...)
```

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

Reply via email to