[Bugfix] fixed concurrent modification of list when removing elements

This commit is contained in:
Robert von Burg 2014-07-31 16:35:29 +02:00
parent ddf7c95bb5
commit 57607ae23c
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ public class InMemoryDao<T extends StrolchElement> implements StrolchDao<T> {
public long removeAll() {
long removed = 0;
for (String type : this.elementMap.keySet()) {
Set<String> keySet = new HashSet<String>(this.elementMap.keySet());
for (String type : keySet) {
Map<String, T> byType = this.elementMap.remove(type);
removed += byType.size();
byType.clear();