You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling replaceAll() on the mutable builder of a PersistentMap throws a ConcurrentModificationException.
Reproduction
To reproduce:
val pmap = persistentMapOf("a" to 1, "b" to 2)
val mmap = pmap.builder()
mmap.replaceAll { _, u -> u + 1 } // throws ConcurrentModificationException
mmap.build()
What I expected
A persistent map with the mapping "a" to 2, "b" to 3.
What I got
An exception:
java.util.ConcurrentModificationException
at kotlinx.collections.immutable.implementations.persistentOrderedMap.PersistentOrderedMapBuilderLinksIterator.checkForComodification(PersistentOrderedMapBuilderContentIterators.kt:57)
at kotlinx.collections.immutable.implementations.persistentOrderedMap.PersistentOrderedMapBuilderLinksIterator.next(PersistentOrderedMapBuilderContentIterators.kt:26)
at kotlinx.collections.immutable.implementations.persistentOrderedMap.PersistentOrderedMapBuilderEntriesIterator.next(PersistentOrderedMapBuilderContentIterators.kt:69)
at kotlinx.collections.immutable.implementations.persistentOrderedMap.PersistentOrderedMapBuilderEntriesIterator.next(PersistentOrderedMapBuilderContentIterators.kt:61)
at java.util.Map.replaceAll(Map.java:675)
The text was updated successfully, but these errors were encountered:
Calling
replaceAll()
on the mutable builder of aPersistentMap
throws aConcurrentModificationException
.Reproduction
To reproduce:
What I expected
A persistent map with the mapping
"a" to 2, "b" to 3
.What I got
An exception:
The text was updated successfully, but these errors were encountered: