RFR: 8372134: ThreadLocalRandom no longer overrides nextGaussian [v2]

James Yuzawa duke at openjdk.org
Tue Nov 25 18:42:20 UTC 2025


On Tue, 25 Nov 2025 17:00:28 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Right, this will require attention. You kinda want `{@inheritDoc java.util.random.RandomGenerator}` but without overriding the method description then it won't appear in the Method Summary. The nextGaussian method defined by j.u.Random and j.u.random.RandomGenrator will be listed in the "Method declared by ..." section of course. 
>> 
>> In addition, Random's implSpec has the polar method whereas RandomGenrator's implSpec is ziggurat algorithm. So I think TLR.nextGaussian will need to copy from text RandomSupport.computeNextGaussian to get the right comment.
>
> In passing, I see there are several empty "Implementation Note:" in the TLR docs. It seems to be `@implNote {@inheritDoc}` when there isn't anything to inherit.

I have updated the javadoc here to copy over the basic parts of RandomGenerator.nextGaussian(). I ported over the comment from the top of TLR into an implementation note. Additionally, I removed the 4 spurious `@implNote {@inheritDoc}` usages, which I found to be empty in https://docs.oracle.com/en/java/javase/25/docs/api//java.base/java/util/concurrent/ThreadLocalRandom.html

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28483#discussion_r2561035881


More information about the core-libs-dev mailing list