> +
> +   private static String parseVersion(String version) {
> +      if(version.contains("-")) {
> +         String rawVersion = version.substring(0,
> +                 version.lastIndexOf("-"));
> +         if(Iterables.size(Splitter.on(".").split(rawVersion)) == 3) {
> +            return rawVersion.substring(0, rawVersion.lastIndexOf("."));
> +         } else {
> +            return rawVersion;
> +         }
> +      } else if(version.contains(" ")) {
> +         version.substring(0,
> +                 version.indexOf(" "));
> +      }
> +      return null;
> +   }

The same applies here. Reuse the functions instead of duplicating them.

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

Reply via email to