Closed
Description
If you use recursive getOrElseUpdate
you can easily end up with a map that contains the same key twice with different values:
val map = mutable.Map[String, String]()
map.getOrElseUpdate("key", {
map.getOrElseUpdate("key", "value1")
"value2"
})
map
The second call could come from another place in the application this is just a sample.