mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Prevent concurrent modification exception when moving token to a zone besides the graveyard
This commit is contained in:
@@ -251,4 +251,10 @@ public class FCollection<T> implements List<T>, Set<T>, FCollectionView<T>, Clon
|
||||
}
|
||||
return subList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<T> threadSafeIterator() {
|
||||
//create a new linked list for iterating to make it thread safe and avoid concurrent modification exceptions
|
||||
return new LinkedList<T>(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,5 @@ public interface FCollectionView<T> extends Iterable<T> {
|
||||
int lastIndexOf(Object o);
|
||||
boolean contains(Object o);
|
||||
List<T> subList(int fromIndex, int toIndex);
|
||||
Iterable<T> threadSafeIterator();
|
||||
}
|
||||
Reference in New Issue
Block a user