From 89cef7cfd4189d587c761c13669a3bc9efcfbfff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Mon, 8 Mar 2010 12:35:44 +0100 Subject: [PATCH] ItEr50S04ValidacionEProbasFuncionaisItEr49S04: Using already existent filter methods instead of doing the instanceof check manually --- .../web/resourceload/ResourceLoadModel.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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(