ItEr50S04ValidacionEProbasFuncionaisItEr49S04: Using already existent
filter methods instead of doing the instanceof check manually
This commit is contained in:
parent
19ed6e3dad
commit
89cef7cfd4
1 changed files with 4 additions and 14 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue