[Bug #1304] Reorder the code to improve the performance with TaskGroups.

FEA: ItEr75S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2011-12-22 12:34:06 +01:00
parent 7c158ad7f6
commit c2889c88b7

View file

@ -592,6 +592,13 @@ public class TaskElementAdapter {
private GanttDate getAdvanceEndDate(BigDecimal advancePercentage) {
BigDecimal hours = BigDecimal.ZERO;
if (taskElement instanceof TaskGroup) {
//progess calculation for TaskGroups is done with
//this method, which is much lighter
return calculateLimitDateByPercentage(advancePercentage);
}
if (taskElement.getOrderElement() != null) {
if(taskElement.getParent() == null){
//it's an order, we use the cached value
@ -604,10 +611,6 @@ public class TaskElementAdapter {
}
}
if (taskElement instanceof TaskGroup) {
return calculateLimitDateByPercentage(advancePercentage);
}
// Calculate date according to advanceHours or advancePercentage
final Integer advanceHours = advancePercentage.multiply(
hours).intValue();