> +import com.google.common.base.Splitter; > +import com.google.common.collect.Iterables; > + > +import static com.google.common.collect.Iterables.getLast; > + > +/** > + * @author Andrea Turli > + */ > +public class OperatingSystems { > + > + public static Function<String, Integer> bits() { > + return new Function<String, Integer>() { > + @Override > + public Integer apply(String operatingSystemReferenceCode) { > + if (operatingSystemReferenceCode != null) { > + return > Integer.parseInt(getLast(Splitter.on("_").split(operatingSystemReferenceCode)));
If the function is allowed to return null, perhaps it is better to use `Ints.tryParse` instead of `parseInt` to avoid throwing an exception and return null instead. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/296/files#r11137001