Ensure that getResourcesPerDay never returns null
FEA: ItEr66S04BugFixing
This commit is contained in:
parent
9a9afdc5c9
commit
a42018bfc5
2 changed files with 4 additions and 3 deletions
|
|
@ -442,6 +442,7 @@ public abstract class ResourceAllocation<T extends DayAssignment> extends
|
|||
private AssignmentFunction assignmentFunction;
|
||||
|
||||
@OnCopy(Strategy.SHARE)
|
||||
@NotNull
|
||||
private ResourcesPerDay resourcesPerDay;
|
||||
|
||||
private Integer intendedTotalHours;
|
||||
|
|
@ -1416,8 +1417,10 @@ public abstract class ResourceAllocation<T extends DayAssignment> extends
|
|||
return calculateResourcesPerDayFromAssignments(getConsolidatedAssignments());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ResourcesPerDay getResourcesPerDay() {
|
||||
if (resourcesPerDay == null) {
|
||||
return ResourcesPerDay.amount(0);
|
||||
}
|
||||
return resourcesPerDay;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -215,8 +215,6 @@ public abstract class ResourcesPerDayModification extends
|
|||
Collection<? extends ResourceAllocation<?>> allocations) {
|
||||
List<ResourcesPerDayModification> result = new ArrayList<ResourcesPerDayModification>();
|
||||
for (ResourceAllocation<?> resourceAllocation : allocations) {
|
||||
ResourcesPerDay perDay = resourceAllocation.getResourcesPerDay();
|
||||
Validate.notNull(perDay);
|
||||
result.add(resourceAllocation.asResourcesPerDayModification());
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue