> private Map<String, SoftwareDescription>
> extractSoftwareDescriptions(Set<VirtualGuestBlockDeviceTemplateGroup> images)
> {
> Map<String, SoftwareDescription> softwareDescriptions =
> Maps.newHashMap();
> for (VirtualGuestBlockDeviceTemplateGroup image : images) {
> final String globalIdentifier = image.getGlobalIdentifier();
> for (VirtualGuestBlockDeviceTemplateGroup child :
> image.getChildren()) {
> for (VirtualGuestBlockDeviceTemplate blockDeviceTemplate :
> child.getBlockDevices()) {
> - for (VirtualDiskImageSoftware softwareReference :
> blockDeviceTemplate.getDiskImage().getSoftwareReferences()) {
> - softwareDescriptions.put(globalIdentifier,
> softwareReference.getSoftwareDescription());
> + // filter for the device 0 (bootable)
> + if (blockDeviceTemplate.getDevice().equals("0")) {
Wirth refactoring to a reusable `isBootableDevice` predicate, and use it to
filter the `child.getBlockDevices()` collection in the loop, instead of having
this `if` statement?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/568/files#r18695190