Source:
<code>private List<VDS> runFilters(List<Guid> filters, List<VDS> hostList, VM vm, Map<String, String> parameters, Map<Guid, Integer> filterPositionMap, List<String> messages, VdsFreeMemoryChecker memoryChecker, boolean shouldRunExternalFilters, String correlationId) { SchedulingResult result = new SchedulingResult(); <START> ArrayList<PolicyUnitImpl> internalFilters = new ArrayList<>(); <END> ArrayList<PolicyUnitImpl> externalFilters = new ArrayList<>(); filters = new ArrayList<>(filters); sortFilters(filters, filterPositionMap); for (Guid filter : filters) { PolicyUnitImpl filterPolicyUnit = policyUnits.get(filter); if (filterPolicyUnit.getPolicyUnit().isInternal()) { internalFilters.add(filterPolicyUnit); } else { if (filterPolicyUnit.getPolicyUnit().isEnabled()) { externalFilters.add(filterPolicyUnit); } } } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_NO_HOSTS.name()); messages.addAll(result.getReasonMessages()); return hostList; } hostList = runInternalFilters(internalFilters, hostList, vm, parameters, filterPositionMap, memoryChecker, correlationId, result); if (shouldRunExternalFilters && Config.<Boolean>getValue(ConfigValues.ExternalSchedulerEnabled) && !externalFilters.isEmpty() && hostList != null && !hostList.isEmpty()) { hostList = runExternalFilters(externalFilters, hostList, vm, parameters, messages, correlationId, result); } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_ALL_HOSTS_FILTERED_OUT.name()); messages.addAll(result.getReasonMessages()); } return hostList; }</code><technical_language>this well</technical_language>

Target:
private List<VDS> runFilters(List<Guid> filters, List<VDS> hostList, VM vm, Map<String, String> parameters, Map<Guid, Integer> filterPositionMap, List<String> messages, VdsFreeMemoryChecker memoryChecker, boolean shouldRunExternalFilters, String correlationId) { SchedulingResult result = new SchedulingResult(); List<PolicyUnitImpl> internalFilters = new ArrayList<>(); List<PolicyUnitImpl> externalFilters = new ArrayList<>(); filters = new ArrayList<>(filters); sortFilters(filters, filterPositionMap); for (Guid filter : filters) { PolicyUnitImpl filterPolicyUnit = policyUnits.get(filter); if (filterPolicyUnit.getPolicyUnit().isInternal()) { internalFilters.add(filterPolicyUnit); } else { if (filterPolicyUnit.getPolicyUnit().isEnabled()) { externalFilters.add(filterPolicyUnit); } } } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_NO_HOSTS.name()); messages.addAll(result.getReasonMessages()); return hostList; } hostList = runInternalFilters(internalFilters, hostList, vm, parameters, filterPositionMap, memoryChecker, correlationId, result); if (shouldRunExternalFilters && Config.<Boolean>getValue(ConfigValues.ExternalSchedulerEnabled) && !externalFilters.isEmpty() && hostList != null && !hostList.isEmpty()) { hostList = runExternalFilters(externalFilters, hostList, vm, parameters, messages, correlationId, result); } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_ALL_HOSTS_FILTERED_OUT.name()); messages.addAll(result.getReasonMessages()); } return hostList; }