Fix crash when editing an application period #117
@ -176,10 +176,12 @@ public class ApplicationPeriod extends DomainObject {
|
|||||||
return Collections.unmodifiableSet(answerSet);
|
return Collections.unmodifiableSet(answerSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProjectTypes(Iterable<ProjectType> projectTypes) {
|
public void setProjectTypes(Set<ProjectType> projectTypes) {
|
||||||
this.projectTypes.clear();
|
this.projectTypes.removeIf(appt -> !projectTypes.contains(appt.getProjectType()));
|
||||||
for (ProjectType pt : projectTypes) {
|
for (ProjectType pt : projectTypes) {
|
||||||
this.projectTypes.add(new ApplicationPeriodProjectType(this, pt));
|
if (this.projectTypes.stream().noneMatch(appt -> appt.getProjectType().equals(pt))) {
|
||||||
|
addProjectType(pt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user