ItEr36S11CUCreacionUnidadesPlanificacionItEr35S12: Avoding moving allocations computation if the start date is at the same day.

This commit is contained in:
Óscar González Fernández 2009-11-25 01:06:58 +01:00
parent 570129aea3
commit 5564fd613e

View file

@ -164,11 +164,15 @@ public abstract class TaskElement extends BaseEntity {
if (newStartDate == null) {
return;
}
boolean sameDay = new LocalDate(newStartDate).equals(new LocalDate(
startDate));
long durationMilliseconds = this.endDate.getTime()
- this.startDate.getTime();
this.startDate = newStartDate;
this.endDate = new Date(this.startDate.getTime() + durationMilliseconds);
moveAllocations();
if (!sameDay) {
moveAllocations();
}
}
protected abstract void moveAllocations();