Parent recalculations must be the ones that are done first.

FEA: ItEr74S04BugFixing
This commit is contained in:
Óscar González Fernández 2011-05-24 16:46:18 +02:00
parent c13bb9bb2a
commit 48ba72511d

View file

@ -459,6 +459,13 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
@Override
public int compare(Recalculation o1, Recalculation o2) {
// recalculations that are parent recalculations must go
// first
int result = asInt(o2.parentRecalculation)
- asInt(o1.parentRecalculation);
if (result != 0) {
return result;
}
int o1Depth = onNullDefault(
taskPointsByDepth.get(o1.taskPoint),
Integer.MAX_VALUE, "no depth value for "
@ -467,12 +474,7 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
taskPointsByDepth.get(o2.taskPoint),
Integer.MAX_VALUE, "no depth value for "
+ o2.taskPoint);
int result = o1Depth - o2Depth;
if (result == 0) {
return asInt(o2.parentRecalculation)
- asInt(o1.parentRecalculation);
}
return result;
return o1Depth - o2Depth;
}
private int asInt(boolean b) {