intermediatePremium

The Mutable Key Trap

Why your HashSet loses the live object

The Mutable Key Trap

Mutate a key's hashCode fields after inserting it and hash-based lookups break - the entry stays in its old bucket while contains() searches the new one.

The narrated version of this skribble — tap play for the full-size video.

1:49

The Mutable Key Trap

Premium
🔒

Premium skribble

The preview above is intentionally blurred. Unlock the full-resolution skribble — and its deep-dive board — with TechSkribble.

Unlock this course Already purchased? Sign in
#java#gotchas#collections#hashcode