[Bug #871] The problem is due to receiving an empty list of tasks
When the critical path received is empty the PlanningDate can't be updated. Instead a warning is logged. FEA: ItEr71S04BugFixing
This commit is contained in:
parent
184499d3cc
commit
03febe580f
1 changed files with 8 additions and 0 deletions
|
|
@ -24,6 +24,8 @@ package org.navalplanner.business.planner.entities;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.navalplanner.business.common.BaseEntity;
|
||||
|
||||
/**
|
||||
|
|
@ -37,6 +39,8 @@ import org.navalplanner.business.common.BaseEntity;
|
|||
*/
|
||||
public class PlanningData extends BaseEntity {
|
||||
|
||||
private static Log LOG = LogFactory.getLog(PlanningData.class);
|
||||
|
||||
public static PlanningData create(TaskGroup rootTask) {
|
||||
return new PlanningData(rootTask);
|
||||
}
|
||||
|
|
@ -64,6 +68,10 @@ public class PlanningData extends BaseEntity {
|
|||
}
|
||||
|
||||
public void update(List<Task> criticalPath) {
|
||||
if (criticalPath.isEmpty()) {
|
||||
LOG.warn("it can't be updated because the critical path provided is empty");
|
||||
return;
|
||||
}
|
||||
progressByDuration = calculateByDuration(criticalPath);
|
||||
progressByNumHours = calculateByNumHours(criticalPath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue