Skip to content

Commit 62d72de

Browse files
author
Bradford Wetmore
committed
8220730: sun.security.provider.SecureRandom default constructor has wrong documentation
Reviewed-by: weijun
1 parent 4e43b28 commit 62d72de

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

src/java.base/share/classes/sun/security/provider/SecureRandom.java

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -65,16 +65,21 @@ public final class SecureRandom extends SecureRandomSpi
6565
private int remCount;
6666

6767
/**
68-
* This empty constructor automatically seeds the generator. We attempt
69-
* to provide sufficient seed bytes to completely randomize the internal
70-
* state of the generator (20 bytes). Note, however, that our seed
71-
* generation algorithm has not been thoroughly studied or widely deployed.
72-
*
73-
* <p>The first time this constructor is called in a given Virtual Machine,
74-
* it may take several seconds of CPU time to seed the generator, depending
75-
* on the underlying hardware. Successive calls run quickly because they
76-
* rely on the same (internal) pseudo-random number generator for their
77-
* seed bits.
68+
* An empty constructor that creates an unseeded SecureRandom object.
69+
* <p>
70+
* Unless the user calls setSeed(), the first call to engineGetBytes()
71+
* will have the SeedGenerator provide sufficient seed bytes to
72+
* completely randomize the internal state of the generator (20 bytes).
73+
* Note that the old threaded seed generation algorithm is provided
74+
* only as a fallback, and has not been thoroughly studied or widely
75+
* deployed.
76+
* <p>
77+
* The SeedGenerator relies on a VM-wide entropy pool to generate
78+
* seed bytes for these objects. The first time the SeedGenerator is
79+
* called, it may take several seconds of CPU time to initialize,
80+
* depending on the underlying hardware. Successive calls run
81+
* quickly because they rely on the same (internal) pseudo-random
82+
* number generator for their seed bits.
7883
*/
7984
public SecureRandom() {
8085
init(null);

0 commit comments

Comments
 (0)