Remove duplicated method in TaskElement
FEA: ItEr75S04BugFixing
This commit is contained in:
parent
af84f83c5f
commit
b365d3b46c
4 changed files with 4 additions and 29 deletions
|
|
@ -398,8 +398,7 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
} else {
|
||||
TaskSource taskSource = getTaskSource();
|
||||
if (taskSource != null) {
|
||||
taskSource.getTask().detachFromDependencies();
|
||||
taskSource.getTask().detachFromParent();
|
||||
taskSource.getTask().detach();
|
||||
getCurrentSchedulingData().taskSourceRemovalRequested();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class OrderLineGroup extends OrderElement implements
|
|||
TaskGroup group = (TaskGroup) getThis().getTaskSource()
|
||||
.getTask();
|
||||
group.remove(childTask);
|
||||
childTask.detachFromDependencies();
|
||||
childTask.detachDependencies();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -306,8 +306,7 @@ public class TaskSource extends BaseEntity {
|
|||
|
||||
@Override
|
||||
public TaskElement apply(IOptionalPersistence optionalPersistence) {
|
||||
taskSource.getTask().detachFromDependencies();
|
||||
taskSource.getTask().detachFromParent();
|
||||
taskSource.getTask().detach();
|
||||
optionalPersistence.remove(taskSource);
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
|
@ -477,7 +476,7 @@ public abstract class TaskElement extends BaseEntity {
|
|||
return result;
|
||||
}
|
||||
|
||||
private void detachDependencies() {
|
||||
public void detachDependencies() {
|
||||
detachOutcomingDependencies();
|
||||
detachIncomingDependencies();
|
||||
}
|
||||
|
|
@ -651,28 +650,6 @@ public abstract class TaskElement extends BaseEntity {
|
|||
this.advancePercentage = advancePercentage;
|
||||
}
|
||||
|
||||
public void detachFromDependencies() {
|
||||
for (Dependency each : copy(getDependenciesWithThisDestination())) {
|
||||
detachDependency(each);
|
||||
}
|
||||
for (Dependency each : copy(getDependenciesWithThisOrigin())) {
|
||||
detachDependency(each);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the dependencies to a list in order to avoid
|
||||
* {@link ConcurrentModificationException}
|
||||
*/
|
||||
private List<Dependency> copy(Set<Dependency> dependencies) {
|
||||
return new ArrayList<Dependency>(dependencies);
|
||||
}
|
||||
|
||||
private void detachDependency(Dependency each) {
|
||||
each.getOrigin().removeDependencyWithDestination(each.getDestination(),
|
||||
each.getType());
|
||||
}
|
||||
|
||||
private Integer sumOfHoursAllocated = 0;
|
||||
|
||||
public void setSumOfHoursAllocated(Integer sumOfHoursAllocated) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue