From 7af65bb33333a8decc2efa4621ab9a50f2e56c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Wed, 2 Dec 2009 00:47:26 +0100 Subject: [PATCH] ItEr37S08CUCreacionUnidadesPlanificacionItEr36S11: Completing condition --- .../entities/AggregateOfResourceAllocations.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/AggregateOfResourceAllocations.java b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/AggregateOfResourceAllocations.java index 991a8ed08..20686fd66 100644 --- a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/AggregateOfResourceAllocations.java +++ b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/AggregateOfResourceAllocations.java @@ -65,7 +65,16 @@ public class AggregateOfResourceAllocations { } public boolean isEmpty() { - return resourceAllocations.isEmpty(); + return resourceAllocations.isEmpty() || allEmpty(); + } + + private boolean allEmpty() { + for (ResourceAllocation each : resourceAllocations) { + if (each.hasAssignments()) { + return false; + } + } + return true; } public List> getAllocationsSortedByStartDate() {