RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v8]

Per Minborg pminborg at openjdk.org
Mon Mar 31 06:35:07 UTC 2025


On Tue, 25 Mar 2025 23:28:46 GMT, Johannes Graham <duke at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Revamp toString() methods
>
> src/java.base/share/classes/jdk/internal/lang/stable/StableValueFactories.java line 41:
> 
>> 39:     public static <T, R> Function<T, R> function(Set<? extends T> inputs,
>> 40:                                                  Function<? super T, ? extends R> original) {
>> 41:         if (inputs.isEmpty()) {
> 
> If it is worth optimizing the isEmpty scenario, it might be preferable to let each xxxFunction.of return an appropriate instance, to keep the number of varying subclasses to a minimum.

I've removed the specialized empty class.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2020469763


More information about the hotspot-dev mailing list