Bug #1606: Revert fix for bug #1546 wich causes regressions on dependencies after saving project

This reverts commit 9a8d7deffe7bb5034448f698ab3dff4014b1bdb1.

The original fix on the patch "Bug #1546: Force recalculation of critical path progresses on
saving project" is having a side-effect on the behaviour of the dependencies, that don't push
tasks and are show violated.

As the regression effect is more severe than the original bug, we revert the patch while finding
another solution for the original issue.
This commit is contained in:
Lorenzo Tilve Álvaro 2013-04-29 12:51:32 +02:00
parent 0486bef3ea
commit e9ecd93966
3 changed files with 2 additions and 12 deletions

View file

@ -70,7 +70,6 @@ import org.libreplan.business.planner.entities.consolidations.CalculatedConsolid
import org.libreplan.business.requirements.entities.CriterionRequirement; import org.libreplan.business.requirements.entities.CriterionRequirement;
import org.libreplan.business.resources.daos.ICriterionDAO; import org.libreplan.business.resources.daos.ICriterionDAO;
import org.libreplan.business.resources.daos.IResourceDAO; import org.libreplan.business.resources.daos.IResourceDAO;
import org.libreplan.business.resources.daos.IResourcesSearcher;
import org.libreplan.business.resources.entities.Criterion; import org.libreplan.business.resources.entities.Criterion;
import org.libreplan.business.resources.entities.CriterionSatisfaction; import org.libreplan.business.resources.entities.CriterionSatisfaction;
import org.libreplan.business.resources.entities.IAssignmentsOnResourceCalculator; import org.libreplan.business.resources.entities.IAssignmentsOnResourceCalculator;
@ -88,7 +87,6 @@ import org.libreplan.business.users.entities.UserOrderAuthorization;
import org.libreplan.web.UserUtil; import org.libreplan.web.UserUtil;
import org.libreplan.web.calendars.BaseCalendarModel; import org.libreplan.web.calendars.BaseCalendarModel;
import org.libreplan.web.planner.TaskElementAdapter; import org.libreplan.web.planner.TaskElementAdapter;
import org.libreplan.web.planner.tabs.CriticalPathBuilder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
@ -181,9 +179,6 @@ public class PlanningStateCreator {
@Autowired @Autowired
private IMoneyCostCalculator moneyCostCalculator; private IMoneyCostCalculator moneyCostCalculator;
@Autowired
private IResourcesSearcher resourcesSearcher;
void synchronizeWithSchedule(Order order, IOptionalPersistence persistence) { void synchronizeWithSchedule(Order order, IOptionalPersistence persistence) {
List<TaskSourceSynchronization> synchronizationsNeeded = order List<TaskSourceSynchronization> synchronizationsNeeded = order
.calculateSynchronizationsNeeded(); .calculateSynchronizationsNeeded();
@ -1122,10 +1117,6 @@ public class PlanningStateCreator {
savedOrderState = order.getState(); savedOrderState = order.getState();
} }
public List<TaskElement> getCriticalPath() {
return CriticalPathBuilder.criticalPathFor(this, resourcesSearcher);
}
} }
public interface IAllocationCriteria { public interface IAllocationCriteria {

View file

@ -396,7 +396,6 @@ public class SaveCommandBuilder {
// the deletes on cascade a new root task is fetched causing a // the deletes on cascade a new root task is fetched causing a
// NonUniqueObjectException later // NonUniqueObjectException later
taskElementDAO.reattach(rootTask); taskElementDAO.reattach(rootTask);
rootTask.updateCriticalPathProgress(state.getCriticalPath());
} }
orderDAO.save(order); orderDAO.save(order);

View file

@ -95,7 +95,7 @@ public class CriticalPathBuilder {
}); });
} }
public static List<TaskElement> criticalPathFor(PlanningState state, private List<TaskElement> criticalPathFor(PlanningState state,
IResourcesSearcher resourcesSearcher) { IResourcesSearcher resourcesSearcher) {
final Order order = state.getOrder(); final Order order = state.getOrder();
final Scenario currentScenario = state.getCurrentScenario(); final Scenario currentScenario = state.getCurrentScenario();
@ -110,7 +110,7 @@ public class CriticalPathBuilder {
return criticalPathCalculator.calculateCriticalPath(graph); return criticalPathCalculator.calculateCriticalPath(graph);
} }
private static LocalDate asLocalDate(Date date) { private LocalDate asLocalDate(Date date) {
return date != null ? LocalDate.fromDateFields(date) : null; return date != null ? LocalDate.fromDateFields(date) : null;
} }