diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/resourceload/ResourceLoadModel.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/resourceload/ResourceLoadModel.java index 79e04f054..c2f6abed1 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/resourceload/ResourceLoadModel.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/resourceload/ResourceLoadModel.java @@ -303,24 +303,14 @@ public class ResourceLoadModel implements IResourceLoadModel { private List onlyGeneric( List> sortedByStartDate) { - List result = new ArrayList(); - for (ResourceAllocation r : sortedByStartDate) { - if (r instanceof GenericResourceAllocation) { - result.add((GenericResourceAllocation) r); - } - } - return result; + return ResourceAllocation.getOfType(GenericResourceAllocation.class, + sortedByStartDate); } private List onlySpecific( List> sortedByStartDate) { - List result = new ArrayList(); - for (ResourceAllocation r : sortedByStartDate) { - if (r instanceof SpecificResourceAllocation) { - result.add((SpecificResourceAllocation) r); - } - } - return result; + return ResourceAllocation.getOfType(SpecificResourceAllocation.class, + sortedByStartDate); } private List buildTimeLinesForEachCriterion(