Skip to content
Tagged articles

static final

4 articles · Page 1 of 1
LuTiao Programming
LuTiao Programming
Nov 14, 2026 · Backend Development

Java 27 LazyConstant: Fix 6s Startup Delay Caused by Eager static final Initialization

The author traces a 6-second Java service startup delay to eager initialization of large objects via static final fields, demonstrates how Java 27's LazyConstant API enables thread-safe, one-time lazy initialization with constant semantics, and explains when to use it versus Spring @Lazy, caches, or double-checked locking.

JEP 531Java 27Kubernetes scaling
0 likes · 19 min read
Java 27 LazyConstant: Fix 6s Startup Delay Caused by Eager static final Initialization
samdeepthink
samdeepthink
Jun 1, 2026 · Backend Development

Why One ThreadLocal Instance Suffices for an Entire Business Scenario

The article explains that a single ThreadLocal object can be shared across dozens of threads because the actual data lives in each thread's own ThreadLocalMap, outlines how set/get work, highlights thread‑pool pitfalls such as stale data and memory leaks, and provides best‑practice guidelines for static declaration, proper removal, and using TransmittableThreadLocal for cross‑thread propagation.

JavaMemory LeakThreadLocal
0 likes · 10 min read
Why One ThreadLocal Instance Suffices for an Entire Business Scenario
LuTiao Programming
LuTiao Programming
Dec 16, 2025 · Fundamentals

Stop Misusing Constants: Why Java Enums Are Replacing static final

The article explains why traditional static final String constants are error‑prone and demonstrates how Java enums—introduced in Java 5—provide stronger type safety, clearer semantics, built‑in methods, and safer switch handling, making them a superior modeling choice for fixed, related values.

DesignEnumJava
0 likes · 8 min read
Stop Misusing Constants: Why Java Enums Are Replacing static final