-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.util.ConcurrentModificationException in PersistentMap.mutate {} #146
Comments
That is rather expected: a mutable map cannot be mutated while it is iterated. |
replaceAll causes the same issue… |
The parameter of the mutate lambda is a mutable map, not the persistent map itself. The ‘it’ iterated by the forEach loop is the mutator, not the persistent map. So what you intend to do should work if you write ‘map.forEach’ instead of ‘it.forEach’ |
@fitermay I can confirm map.forEach works. However, I am stumped as to why |
Cause error:
|
I'm also bitten by this, using |
Please note that the mutable version passed into |
Using
put
multiple times inPersistentMap.mutate
block results injava.util.ConcurrentModificationException
.Can be reproduced in 0.3.5 with the following code:
The text was updated successfully, but these errors were encountered: