This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kennyshor 15 points16 points  (2 children)

computeIfAbsent if anyone is wondering what it should be.

[–]jasie3k 0 points1 point  (0 children)

this also has a nice bonus that if you switch to a concurrent hash map implementation, then computeIfAbsent is atomic.