[Bug #916] Fixed issue checking if list of constraints is empty and not only if it is null.

FEA: ItEr72S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2011-03-07 10:08:14 +01:00
parent be05e7fcec
commit 488b3958a8

View file

@ -311,13 +311,14 @@ public class CriticalPathCalculator<T, D extends IDependency<T>> {
.getStartConstraintsFor(task);
List<Constraint<GanttDate>> endConstraints = graph
.getEndConstraintsFor(task);
if ((startConstraints == null) && (endConstraints == null)) {
if ((startConstraints == null || startConstraints.isEmpty())
&& (endConstraints == null || endConstraints.isEmpty())) {
return null;
}
if (startConstraints == null) {
if (startConstraints == null || startConstraints.isEmpty()) {
return Constraint.coalesce(endConstraints);
}
if (endConstraints == null) {
if (endConstraints == null || endConstraints.isEmpty()) {
return Constraint.coalesce(startConstraints);
}
startConstraints.addAll(endConstraints);