ItEr19S08CUCreacionProxectoPlanificacionItEr18S08: a transient TaskElement could be removed from the interface, but you can't remove it in the database.

This commit is contained in:
Óscar González Fernández 2009-07-24 21:09:19 +02:00 committed by Javier Moran Rua
parent ce0a7a5c72
commit d78738e11d

View file

@ -31,7 +31,18 @@ public class PlanningState {
}
public Collection<? extends TaskElement> getToRemove() {
return Collections.unmodifiableCollection(toRemove);
return Collections.unmodifiableCollection(onlyNotTransient(toRemove));
}
private List<TaskElement> onlyNotTransient(
Collection<? extends TaskElement> toRemove) {
ArrayList<TaskElement> result = new ArrayList<TaskElement>();
for (TaskElement taskElement : toRemove) {
if (taskElement.getId() != null) {
result.add(taskElement);
}
}
return result;
}
public void removed(TaskElement taskElement) {