> +      });
> +      if (!optionalBootableVolume.isPresent()) {
> +         return Type.LOCAL.ordinal();
> +      }
> +      return optionalBootableVolume.get().getType().ordinal();
> +   }
> +
> +   private Optional<OperatingSystem> tryExtractOperatingSystemFrom(final 
> String imageId) {
> +      Set<OperatingSystem> operatingSystemsAvailable = 
> createObjectOptionsSupplier.get().getVirtualGuestOperatingSystems();
> +      return tryFind(FluentIterable.from(operatingSystemsAvailable)
> +              .filter(new Predicate<OperatingSystem>() {
> +                 @Override
> +                 public boolean apply(OperatingSystem input) {
> +                    return input.getId().contains(imageId);
> +                 }
> +              }), Predicates.notNull());

agreed. the not-null filter is confusing, as you would have gotten a NPE here, 
at `input.getId()` right?

```java
+                    return input.getId().contains(imageId);
```

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

Reply via email to