Feedback on LazyConstants (formerly StableValues)

david Grajales david.1993grajales at gmail.com
Wed Sep 24 04:05:37 UTC 2025


Just to clarify (my previous email had several drafting issues): the
current StableValue API feels clunky, and it forces me into workarounds for
even moderately complex scenarios. Instead of simplifying the declaration
of lazy values, it introduces additional logic and cognitive overhead just
to interact with the API, making it unattractive for lazy
initialization but for the most critical paths. I think a lazy keyword or
an annotation would serve the same purpose in a clearer way; The current
API design still requires helper methods to deal with non-trivial scenarios
that are similar to existing patterns anyway; and would allow for an easier
migration of existing code, at least for what my experiments have shown me
so far.

I still would like to know if there are some advice or better patterns I
may be missing.


Thank you, very much and best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20250923/4129545b/attachment.htm>


More information about the amber-dev mailing list