> + }
> +
> + private String extractOsVersion(OsFamily family, String name) {
> + String version = null;
> + if (family == OsFamily.WINDOWS) {
> + // TODO: Find a way to restrict better the windows version
> + Matcher matcher = WINDOWS_VERSION_PATTERN.matcher(name);
> + if (matcher.matches()) {
> + version = matcher.group(1);
> + }
> + } else {
> + Matcher matcher = UNIX_VERSION_PATTERN.matcher(name);
> + if (matcher.matches()) {
> + version = matcher.group(1);
> + }
> + }
I initially had an inline if, but as the windows pattern has nothing to be with
the unix one, I preferred to have an explicit if. Otherwise it seems that both
patterns *must* use the "group 1" for the version, when that's just a
coincidence. I can change it back if you think it is more readable, though.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/362/files#r13038350