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
Filtering a wrapped Java map throws ConcurrentModificationException. This did not happen in Scala 2.9, but happens in 2.10, including 2.10.1. In the example below call to retain results in exception.
packageissues.issueXXimportorg.scalatest.FlatSpecimportscala.collection.JavaConversions._importscala.collection.mutableclassMapRetainSpecextendsFlatSpec {
"Scala Map conversion" should "support 'retain'" in {
valmapJ=new java.util.HashMap[Int, String]
valmapS: mutable.Map[Int, String] = mapJ
(10 to 20).foreach(i => mapS += ((i, i.toString)))
assert(11=== mapS.size)
// ConcurrentModificationException thrown in the following line
mapS.retain((i, str) => i %2==0)
assert(6=== mapS.size)
}
}
The text was updated successfully, but these errors were encountered:
Filtering a wrapped Java map throws ConcurrentModificationException. This did not happen in Scala 2.9, but happens in 2.10, including 2.10.1. In the example below call to
retain
results in exception.The text was updated successfully, but these errors were encountered: