On Wed, 2 Apr 2025 11:41:30 GMT, Maurizio Cimadamore <[email protected]>
wrote:
>> Per Minborg has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Improve examples
>
> src/java.base/share/classes/java/lang/StableValue.java line 209:
>
>> 207: * private SqrtUtil(){}
>> 208: *
>> 209: * private static final Set<Integer> CACHED_KEYS = Set.of(1, 2, 4,
>> 8, 16, 32);
>
> This is not the same as before, is it? E.g. in the previous example, we had
> cached results for `0 <= input < CACHED_SIZE`. But here we hand-pick some
> values for which we know the square root is also an int. I think the two
> example should be the same, so as to attract attention on how stable int
> function vs. stable function works...
The same discrepancy is present in the list vs. map examples
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2024651952