A deep dive into Java’s integer cache, why == sometimes betrays you, and how a tiny quirk caused a massive bug in production.
Ever had code look you dead in the face and lie to you? That’s what Java did to me when I first discovered that 1 == 1 happily returns true… but 1000 == 1000 betrays you with a cold, hard false. Same number, same syntax,...