Files
javademos/lazy-constants/broken/RemovedApi.java
T
Claude 814c32b5ce Add lazy-constants module: LazyConstant (JEP 531) against the holder idiom and double-checked locking
Basics, failure semantics on 26 vs 27, lazy collections, API across 25/26/27, preview-flag traps and a JMH read-path benchmark (jars fetched and sha1-checked, not committed).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
2026-09-24 12:27:27 +00:00

8 lines
309 B
Java

public class RemovedApi {
public static void main(String[] args) {
LazyConstant<String> c = LazyConstant.of(() -> "x");
System.out.println(c.isInitialized()); // exists on JDK 26, removed in 27
System.out.println(c.orElse("fallback")); // exists on JDK 26, removed in 27
}
}