On Mon, 4 May 2026 14:07:26 GMT, Per Minborg <[email protected]> wrote:

>> Implement JEP 531: Lazy Constants (Third Preview)
>> 
>> This PR replaces _draft_ https://github.com/openjdk/jdk/pull/29507
>> 
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Per Minborg has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains 69 commits:
> 
>  - Reshuffle examples and fix typo
>  - Merge branch 'master' into 
> implement-lazy-constants-third-prewiew-exceptions
>  - Merge branch 'openjdk:master' into master
>  - Merge master
>  - Merge branch 'openjdk:master' into master
>  - Add exampels and reinforce testing
>  - Restrict method and class visitbility
>  - Clean up and add IR tests
>  - Address additional comments
>  - Merge branch 'master' into 
> implement-lazy-constants-third-prewiew-exceptions
>  - ... and 59 more: https://git.openjdk.org/jdk/compare/3c69c969...bdf79df1

src/java.base/share/classes/jdk/internal/lang/LazyConstantImpl.java line 72:

> 70:     // After the function is successfully invoked, the field is set to
> 71:     // `null` to allow the function to be collected. If the function 
> fails, the field is
> 72:     // set to the name of the exception class. We are not storing the 
> exception class

Fully qualified name or simple name?

src/java.base/share/classes/jdk/internal/lang/LazyConstantImpl.java line 111:

> 109:                     throw new NoSuchElementException("Unable to access 
> the constant because " +
> 110:                             computingFunctionOrExceptionType +
> 111:                             " was thrown at initial computation");

Might it not be better to use the same message, but only include the cause the 
"first" time? Makes behavior more consistent.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30194#discussion_r3182727260
PR Review Comment: https://git.openjdk.org/jdk/pull/30194#discussion_r3182735745

Reply via email to