ItEr50S04ValidacionEProbasFuncionaisItEr49S04: Using already existent

filter methods instead of doing the instanceof check manually
This commit is contained in:
Óscar González Fernández 2010-03-08 12:35:44 +01:00
parent 19ed6e3dad
commit 89cef7cfd4

View file

@ -303,24 +303,14 @@ public class ResourceLoadModel implements IResourceLoadModel {
private List<GenericResourceAllocation> onlyGeneric(
List<ResourceAllocation<?>> sortedByStartDate) {
List<GenericResourceAllocation> result = new ArrayList<GenericResourceAllocation>();
for (ResourceAllocation<?> r : sortedByStartDate) {
if (r instanceof GenericResourceAllocation) {
result.add((GenericResourceAllocation) r);
}
}
return result;
return ResourceAllocation.getOfType(GenericResourceAllocation.class,
sortedByStartDate);
}
private List<SpecificResourceAllocation> onlySpecific(
List<ResourceAllocation<?>> sortedByStartDate) {
List<SpecificResourceAllocation> result = new ArrayList<SpecificResourceAllocation>();
for (ResourceAllocation<?> r : sortedByStartDate) {
if (r instanceof SpecificResourceAllocation) {
result.add((SpecificResourceAllocation) r);
}
}
return result;
return ResourceAllocation.getOfType(SpecificResourceAllocation.class,
sortedByStartDate);
}
private List<LoadTimeLine> buildTimeLinesForEachCriterion(