Skip to content

Commit

Permalink
Fixed ConcurrentModificationException in scenario-cutout util (#3624)
Browse files Browse the repository at this point in the history
* Fixed ConcurrentModificationException when loading populations with unselected plans

* Changed to more stable solution (instead of directly  manipulating the list-object, we now use the removePlan-method)

---------

Co-authored-by: rakow <[email protected]>
  • Loading branch information
Aleksander1234519 and rakow authored Dec 11, 2024
1 parent 5f58a97 commit 77bf4a4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,12 @@ public void run(Person person) {
}

// Remove all unselected plans because these are not handled
person.getPlans().stream()
.filter(p -> p != person.getSelectedPlan())
.forEach(person::removePlan);
List<Plan> plans = new ArrayList<>(person.getPlans());
for(Plan p : plans){
if (p != person.getSelectedPlan()){
person.removePlan(p);
}
}
}


Expand Down

0 comments on commit 77bf4a4

Please sign in to comment.