• Sources: primary
  • Summary: OpenJDK has targeted JEP 547, Lazy Constants (Fourth Preview), to JDK 28.
  • Why it matters: Java teams that defer expensive static initialization still need --enable-preview for this API and should expect further changes before it is final.
  • Background: Lazy constants hold a value that is computed at most once, on first use, after which the JIT can treat it like a final field and constant-fold it. They target the gap between eager static final fields, which slow startup, and hand-written lazy holders or double-checked locking, which the JVM cannot optimize as constants. The API began life under the name Stable Values.