On Mon, 13 May 2024 08:47:50 GMT, Raffaello Giulietti <[email protected]>
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.
src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line
187:
> 185: private RandomGeneratorProperties getProperties() {
> 186: if (properties == null) { // volatile load
> 187: synchronized (rgClass) {
The synchronization on `rgClass` to intialize an instance field `properties`
appears odd here. I think this should be synchronized on `this`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19212#discussion_r1598485190