Skip to main content

JWT Refresh Token Rotation in Spring Security 7 (With Reuse Detection)

Build refresh token rotation with token families and reuse detection on Spring Boot 4.1 and Spring Security 7.1. Opaque hashed tokens, a race-proof conditional UPDATE, a grace window, logout everywhere, and the access token that outlives logout, all run and captured.

DateTimeFormatter Cheat Sheet: Patterns, the yyyy vs YYYY Bug, Locales and ISO Formats

A Java DateTimeFormatter cheat sheet where every output was run on JDK 25: pattern letters, why YYYY prints next year in late December (36 wrong days in 11 years for en_US and en_IN), the U+202F space that breaks AM/PM parsing since JDK 20, SMART vs STRICT parsing of 31 February, ISO constants, and a shared SimpleDateFormat that returns wrong dates.

equals() and hashCode() in Java: The Contract, Real Bugs and How Records Change It

Why Java needs both equals() and hashCode(), shown by breaking them: a HashSet holding duplicates, a constant hash costing 2,002,999 comparisons for 2,000 lookups, a mutated key that get() and remove() cannot find, record edge cases, and the JPA entity id trap. Every output is from a JDK 25 run and a committed transcript.

String.format, formatted() and printf in Java: The Complete Cheat Sheet

A Java String.format cheat sheet where every output was run on JDK 25: specifier anatomy, padding and alignment, why %.2f can disagree with C, locale traps, the lakh/crore grouping Formatter cannot produce (with a working formatter), the exceptions it throws, and what it costs against +.