Source:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, PerHostMessages messages) { final VdsDynamic lastHost = getLastHost(vm, hosts); if (lastHost == null) { return hosts; } final OS lastHostOs = OS.fromPackageVersionString(lastHost.getHostOs()); if (!lastHostOs.isValid()) { log.debug("Reference host does not provide a valid and complete OS identifier. Found {}.", lastHost.getId(), lastHost.getHostOs()); messages.addMessage(lastHost.getId(), EngineMessage.VAR__DETAIL__INVALID_OS.name()); messages.addMessage(lastHost.getId(), String.format("$os %1$s", lastHost.getHostOs())); return hosts; } final List<VDS> notOlderHosts = new ArrayList(); for (VDS host : hosts) { final OS hostOs = OS.fromPackageVersionString(host.getHostOs()); if (!hostOs.isValid()) { log.debug("Host does not provides a valid and complete OS identifier. Found {}.", host.getId(), host.getHostOs()); messages.addMessage(host.getId(), EngineMessage.VAR__DETAIL__INVALID_OS.name()); messages.addMessage(host.getId(), String.format("$os %1$s", host.getHostOs())); } else if (!hostOs.isSameOs(lastHostOs)) { log.debug("Host does not run the same operating system. Expected {}, found {}", host.getId(), lastHostOs.getName(), hostOs.getName()); messages.addMessage(host.getId(), EngineMessage.VAR__DETAIL__WRONG_OS.name()); messages.addMessage(host.getId(), String.format("$expected %1$s", lastHostOs.getName())); messages.addMessage(host.getId(), String.format("$found %1$s", hostOs.getName())); } else if (!hostOs.isOlderThan(lastHostOs)) { notOlderHosts.add(host); } } return notOlderHosts; }

Target:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, PerHostMessages messages) { final VdsDynamic lastHost = getLastHost(vm); if (lastHost == null) { return hosts; } final OS lastHostOs = OS.fromPackageVersionString(lastHost.getHostOs()); if (!lastHostOs.isValid()) { log.debug("Reference host does not provide a valid and complete OS identifier. Found {}.", lastHost.getId(), lastHost.getHostOs()); return hosts; } final List<VDS> notOlderHosts = new ArrayList(); for (VDS host : hosts) { final OS hostOs = OS.fromPackageVersionString(host.getHostOs()); if (!hostOs.isValid()) { log.debug("Host does not provides a valid and complete OS identifier. Found {}.", host.getId(), host.getHostOs()); messages.addMessage(host.getId(), EngineMessage.VAR__DETAIL__INVALID_OS.name()); messages.addMessage(host.getId(), String.format("$os %1$s", host.getHostOs())); } else if (!hostOs.isSameOs(lastHostOs)) { log.debug("Host does not run the same operating system. Expected {}, found {}", host.getId(), lastHostOs.getName(), hostOs.getName()); messages.addMessage(host.getId(), EngineMessage.VAR__DETAIL__WRONG_OS.name()); messages.addMessage(host.getId(), String.format("$expected %1$s", lastHostOs.getName())); messages.addMessage(host.getId(), String.format("$found %1$s", hostOs.getName())); } else if (hostOs.isOlderThan(lastHostOs)) { log.debug("Host runs a too old OS version. Found {}", host.getId(), hostOs.getName()); messages.addMessage(host.getId(), EngineMessage.VAR__DETAIL__OLD_OS.name()); messages.addMessage(host.getId(), String.format("$found %1$s", hostOs.getName())); } else { notOlderHosts.add(host); } } return notOlderHosts; }