> +                    .get()).createInIPv4RangeWithGateway(input.getName(), 
> input.getIpV4Range(), input.getGateway().get()));
> +            retry(operationDonePredicate, operationCompleteCheckTimeout, 
> operationCompleteCheckInterval,
> +                    MILLISECONDS).apply(operation);
> +
> +            checkState(!operation.get().getHttpError().isPresent(), "Could 
> not create network, operation failed" + operation);
> +         } else {
> +            AtomicReference<Operation> operation = new 
> AtomicReference<Operation>(api.getNetworkApiForProject(userProject
> +                    .get()).createInIPv4Range(input.getName(), 
> input.getIpV4Range()));
> +            retry(operationDonePredicate, operationCompleteCheckTimeout, 
> operationCompleteCheckInterval,
> +                    MILLISECONDS).apply(operation);
> +
> +            checkState(!operation.get().getHttpError().isPresent(), "Could 
> not create network, operation failed" + operation);
> +         }
> +         return 
> checkNotNull(api.getNetworkApiForProject(userProject.get()).get(input.getName()),
> +                 "no network with name %s was found", input.getName());
> +      } catch (IllegalStateException e) {

?!? If we're going to catch the ISE anyway, why not remove the `checkState` 
above and simply do
```
return api.getNetworkApiForProject(userProject.get()).get(input.getName());
```
Or are there more ISEs coming from calls other than the `checkState`s above..?

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

Reply via email to