RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

Jim Laskey jlaskey at openjdk.java.net
Wed Nov 25 13:54:07 UTC 2020


On Wed, 25 Nov 2020 13:24:37 GMT, Rémi Forax <github.com+828220+forax at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8248862: Implement Enhanced Pseudo-Random Number Generators
>>   
>>   Changes to RandomGeneratorFactory requested by @PaulSandoz
>
> src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java line 433:
> 
>> 431:     private static final class ThreadLocalRandomProxy extends Random {
>> 432:         @java.io.Serial
>> 433:         static final long serialVersionUID = 0L;
> 
> should be private

(instance?) agree

> src/java.base/share/classes/java/security/SecureRandom.java line 223:
> 
>> 221:                 Map.entry(RandomGeneratorProperty.IS_HARDWARE, false)
>> 222:         );
>> 223:     }
> 
> Using Map.of() instead of Map.ofEntries() should simplify the code

I had assumed  Map.ofEntries() was more efficient but it seems it in turn uses MapN as well. Will change these cases.

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

PR: https://git.openjdk.java.net/jdk/pull/1292


More information about the security-dev mailing list