๐ฌ “When I was a fresher, I used to wonder: what things should I never do in Java?” That curiosity led me to explore tons of weird bugs and war stories people had faced in production. Some were scary, some silly — but all of them were super valuable to understand deeply. Today, I’m sharing one such issue I came across. ⚠️ P.S. I didn’t write this code — but I sure learned a lot digging into what went wrong and how it was fixed. ๐
This post is for the curious devs out there — especially freshers who want to learn the "why" behind Java's behaviors, not just memorize "what to do". ๐ฅ The Problem: ConcurrentModificationException in a Simple Loop ๐Environment: This happened in a Spring Boot microservice deployed on OpenShift (Linux-based). Interestingly, it didn’t throw any error in the developer's local Windows machine during testing. But in prod? BOOM. ๐ฃ Here’s the actual buggy code snippet: List<String> users = getActiveUsers(); // ...
A cozy space where I share my daily Java learnings, issues, and solutions.