[Bug #816] Fix bug

The problem lied in that the @NotNull annotation was applied to a
field. This is dangerous because if the object that is being validated
is a proxy, the value is always null. Now the annotation was moved to
the getter.

FEA: ItEr69S04BugFixing
This commit is contained in:
Óscar González Fernández 2011-01-24 18:42:07 +01:00
parent be4bc0092f
commit 9f7e428e4a

View file

@ -443,7 +443,6 @@ public abstract class ResourceAllocation<T extends DayAssignment> extends
private AssignmentFunction assignmentFunction;
@OnCopy(Strategy.SHARE)
@NotNull
private ResourcesPerDay resourcesPerDay;
private Integer intendedTotalHours;
@ -1418,6 +1417,7 @@ public abstract class ResourceAllocation<T extends DayAssignment> extends
return calculateResourcesPerDayFromAssignments(getConsolidatedAssignments());
}
@NotNull
public ResourcesPerDay getResourcesPerDay() {
if (resourcesPerDay == null) {
return ResourcesPerDay.amount(0);