jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds-labs] CloudSigma2 ComputeService and SecurityGroupExtension (#70)
Date Sun, 21 Sep 2014 14:57:38 GMT
> +
> +   @Override
> +   public IpPermission apply(FirewallRule input) {
> +      IpPermission.Builder permissionBuilder = new IpPermission.Builder();
> +      String destinationPort = input.getDestinationPort();
> +      if (destinationPort != null) {
> +         if (destinationPort.contains("!")) {
> +            destinationPort = destinationPort.substring(destinationPort.indexOf("!")
+ 1,
> +                  destinationPort.length());
> +         }
> +         if (destinationPort.contains(":")) {
> +            int[] ports = parsePort(destinationPort);
> +            permissionBuilder.fromPort(ports[0]);
> +            permissionBuilder.toPort(ports[1]);
> +         } else {
> +            permissionBuilder.fromPort(Integer.parseInt(destinationPort));

[minor] Factor `Integer.parseInt(destinationPort)` out as a variable?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/70/files#r17825942
Mime
View raw message