RFR: 8332086: Remove the usage of ServiceLoader in j.u.r.RandomGeneratorFactory [v4]

Jaikiran Pai jpai at openjdk.org
Wed May 15 06:46:06 UTC 2024


On Tue, 14 May 2024 16:08:22 GMT, Raffaello Giulietti <rgiulietti at 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:
> 
>   Replace SimpleImmutableEntry constructor with Map.entry() factory method.

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

> 624:      * and providing a starting long seed.
> 625:      * If a long seed is not supported by the algorithm,
> 626:      * an {@link UnsupportedOperationException} is thrown.

Perhaps reword this and the other `create(byte[])` method to something like:


* Create an instance of {@link RandomGenerator} based on the
* <a href="package-summary.html#algorithms">algorithm</a> chosen,
* and the provided {@code seed}.
* If the {@code RandomGenerator} doesn't support instantiation through
* a {@code seed} of type {@code long} then this method throws an
* an {@link UnsupportedOperationException}.

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

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


More information about the core-libs-dev mailing list