Fix issue with use of SecureRandom for id generation

Switch to using nextBytes as generateSeed doesn't seem to be always
supported by all hardware providers.

Issue: SPR-11278
This commit is contained in:
Rossen Stoyanchev 2014-01-02 11:53:25 -05:00
parent 3b14e974f8
commit 1f49f994e6
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,9 @@ public class AlternativeJdkIdGenerator implements IdGenerator {
public AlternativeJdkIdGenerator() {
byte[] seed = new SecureRandom().generateSeed(8);
SecureRandom secureRandom = new SecureRandom();
byte[] seed = new byte[8];
secureRandom.nextBytes(seed);
this.random = new Random(new BigInteger(seed).longValue());
}