Bug #1518: Prevent removing the same TaskSource twice.

FEA: ItEr76S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2012-07-18 13:21:29 +02:00
parent 39311a7a03
commit 7a48c66771

View file

@ -299,15 +299,16 @@ public abstract class OrderElement extends IntegrationEntity implements
//this element was a container but now it's a scheduling point //this element was a container but now it's a scheduling point
//we have to remove the TaskSource which contains a TaskGroup instead of TaskElement //we have to remove the TaskSource which contains a TaskGroup instead of TaskElement
removeTaskSource(result); removeTaskSource(result);
} } else {
if (hadATaskSource() && currentTaskSourceIsNotTheSame()) { if (hadATaskSource() && currentTaskSourceIsNotTheSame()) {
//this element was unscheduled and then scheduled again. Its TaskSource has //this element was unscheduled and then scheduled again. Its TaskSource has
//been recreated but we have to remove the old one. //been recreated but we have to remove the old one.
if(!getParent().currentTaskSourceIsNotTheSame()) { if(!getParent().currentTaskSourceIsNotTheSame()) {
//we only remove the TaskSource if the parent is not in the same situation. //we only remove the TaskSource if the parent is not in the same situation.
//In case the parent is in the same situation, it will remove the related //In case the parent is in the same situation, it will remove the related
//TaskSources in children tasks. //TaskSources in children tasks.
removeTaskSource(result); removeTaskSource(result);
}
} }
} }
result result
@ -316,14 +317,15 @@ public abstract class OrderElement extends IntegrationEntity implements
removeUnscheduled(result); removeUnscheduled(result);
if (wasASchedulingPoint()) { if (wasASchedulingPoint()) {
result.add(taskSourceRemoval()); result.add(taskSourceRemoval());
} } else {
if (hadATaskSource() && currentTaskSourceIsNotTheSame()) { if (hadATaskSource() && currentTaskSourceIsNotTheSame()) {
//all the children of this element were unscheduled and then scheduled again, //all the children of this element were unscheduled and then scheduled again,
//its TaskSource has been recreated but we have to remove the old one. //its TaskSource has been recreated but we have to remove the old one.
if(getParent() == null || !getParent().currentTaskSourceIsNotTheSame()) { if(getParent() == null || !getParent().currentTaskSourceIsNotTheSame()) {
//if it's a container node inside another container we could have the //if it's a container node inside another container we could have the
//same problem than in the case of leaf tasks. //same problem than in the case of leaf tasks.
result.add(taskSourceRemoval()); result.add(taskSourceRemoval());
}
} }
} }
result result