> +
> + try {
> + if (input.getGateway().isPresent()) {
> + AtomicReference<Operation> operation = new
> AtomicReference<Operation>(api.getNetworkApiForProject(userProject
> + .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);
Move the `retry` and `checkState` commands out of both branches of the `if`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/5/files#r7380950