On Tue, 14 May 2024 13:47:33 GMT, Raffaello Giulietti <rgiulie...@openjdk.org> 
wrote:

>> All random number generator algorithms are implemented in module 
>> `java.base`. The usage of `ServiceLoader` in `j.u.r.RandomGeneratorFactory` 
>> is no longer needed.
>
> Raffaello Giulietti has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Move mathematical logic to record RandomGeneratorProperties.

src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line 
202:

> 200:                 int i, int j, int k, int equidistribution,
> 201:                 int flags) {
> 202:             return new SimpleImmutableEntry<>(name,

This should use [`Map​.Entry​<…>`] as the return type, which in turn allows 
using [`Map​::entry​(K, V)`] as the implementation, as neither the `name` key, 
nor the value is ever `null`:
Suggestion:

        private static Map.Entry<String, RandomGeneratorProperties>
        entry(Class<? extends RandomGenerator> rgClass, String name, String 
group,
                int i, int j, int k, int equidistribution,
                int flags) {
            return Map.entry(name,


[`Map​.Entry​<…>`]: 
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Map.Entry.html
[`Map​::entry​(K, V)`]: 
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Map.html#entry(K,V)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19212#discussion_r1600264879

Reply via email to