From 3c192e0cf8f8dfac7d309c0067b2b6328d4d9e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Mon, 8 Nov 2010 17:02:32 +0100 Subject: [PATCH] Remove unnecessary fields FEA: ItEr61OTS04PlanificacionHaciaAtras --- .../planner/allocation/AllocationResult.java | 8 -------- .../allocation/AllocationRowsHandler.java | 19 ------------------- 2 files changed, 27 deletions(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java index c1fc8fee5..a99dc7490 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java @@ -77,8 +77,6 @@ public class AllocationResult { private final AggregateOfResourceAllocations aggregate; - private final Integer daysDuration; - private final CalculatedValue calculatedValue; private final Task task; @@ -101,8 +99,6 @@ public class AllocationResult { this.task = task; this.calculatedValue = calculatedValue; this.aggregate = aggregate; - this.daysDuration = aggregate.isEmpty() ? task.getDaysDuration() - : aggregate.getDaysDuration(); this.end = aggregate.isEmpty() ? null : aggregate.getEnd(); this.newAllocations = newAllocations; this.modified = modified; @@ -112,10 +108,6 @@ public class AllocationResult { return aggregate; } - public Integer getDaysDuration() { - return daysDuration; - } - private List> getNew() { return newAllocations; } diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java index 3403e7a42..21c15a816 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java @@ -22,7 +22,6 @@ package org.navalplanner.web.planner.allocation; import java.util.ArrayList; import java.util.Collection; -import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -59,8 +58,6 @@ public class AllocationRowsHandler { private CalculatedValue calculatedValue; - private Integer daysDuration; - private final IWorkerFinder workersFinder; private AllocationRowsHandler(Task task, List initialRows, @@ -69,7 +66,6 @@ public class AllocationRowsHandler { this.workersFinder = workersFinder; this.currentRows = new ArrayList(initialRows); this.calculatedValue = task.getCalculatedValue(); - this.daysDuration = task.getDaysDuration(); } public void addSpecificResourceAllocationFor(List resource) { @@ -251,7 +247,6 @@ public class AllocationRowsHandler { createDerived(); AllocationResult result = AllocationResult.create(task, calculatedValue, currentRows); - daysDuration = result.getDaysDuration(); AllocationRow.loadDataFromLast(currentRows); return result; } @@ -318,7 +313,6 @@ public class AllocationRowsHandler { public void setCalculatedValue(CalculatedValue calculatedValue) { this.calculatedValue = calculatedValue; - this.daysDuration = task.getDaysDuration(); } public AllocationResult getInitialAllocation(Scenario currentScenario) { @@ -330,10 +324,6 @@ public class AllocationRowsHandler { return task; } - public Integer getDaysDuration() { - return daysDuration; - } - public Set getAllocationResources() { Set result = new HashSet(); for (AllocationRow each : currentRows) { @@ -342,19 +332,10 @@ public class AllocationRowsHandler { return result; } - public Date getEnd() { - LocalDate start = getStartDate(); - return toDate(start.plusDays(getDaysDuration())); - } - public LocalDate getStartDate() { return new LocalDate(task.getStartDate()); } - private Date toDate(LocalDate date) { - return date.toDateTimeAtStartOfDay().toDate(); - } - public void removeAll() { for (AllocationRow each : copyOfCurrentRowsToAvoidConcurrentModification()) { remove(each);