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

Daniel Fuchs dfuchs at openjdk.org
Mon May 13 14:55:08 UTC 2024


On Mon, 13 May 2024 13:21:23 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> A followup PR is fine. I think once this PR which addresses the API aspects (like removal of ServiceLoader and then updates to the create() method javadoc) is integrated, then the subsequent PR can just be all internal implementation changes like the proposed removal of reflection.
>
> Fine with me.

Not sure if that's an issue - but if you wanted/needed to delay the loading of those random generator classes that will not be used until something actually wants to use them, you could consider using a `Supplier<Class<? extends RandomGenerator>>` or a `Supplier<RandomGenEntry>` for the `FACTORY_MAP` values?

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

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


More information about the core-libs-dev mailing list