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
A really interesting edge case for HashMap was reported due to my usage, see ben-manes/caffeine#176.
It seems that when the entrySet iterator removes entries, the untreeifying causes the entries to be rewritten. Then the entries returned by the iterator are stale and setValue has no effect on the HashMap. This is because unlike concurrent maps, the setValue does not perform a map.put(key, value) to handle the race.
I believe this is a JDK bug and we are awaiting feedback. Guava's testlib doesn't assert this case, so it might be a good addition.
The text was updated successfully, but these errors were encountered:
@ben-manes The way I see it, it's still worth keeping this open since it seems to be interesting edge case worth testing against, at least for custom Map impls like ImmutableMap.
A really interesting edge case for HashMap was reported due to my usage, see ben-manes/caffeine#176.
It seems that when the entrySet iterator removes entries, the untreeifying causes the entries to be rewritten. Then the entries returned by the iterator are stale and
setValue
has no effect on the HashMap. This is because unlike concurrent maps, thesetValue
does not perform amap.put(key, value)
to handle the race.I believe this is a JDK bug and we are awaiting feedback. Guava's testlib doesn't assert this case, so it might be a good addition.
The text was updated successfully, but these errors were encountered: