RFR: 8332086: Remove the usage of ServiceLoader in j.u.r.RandomGeneratorFactory [v3]
Raffaello Giulietti
rgiulietti at openjdk.org
Tue May 14 16:10:03 UTC 2024
On Tue, 14 May 2024 15:40:24 GMT, ExE Boss <duke at openjdk.org> wrote:
>> 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)
@ExE-Boss Thanks for the suggestion.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19212#discussion_r1600303960
More information about the core-libs-dev
mailing list