File tree Expand file tree Collapse file tree
src/java.base/share/classes/java/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -730,10 +730,11 @@ public void setSeed(byte[] seed) {
730730 @ Override
731731 public void setSeed (long seed ) {
732732 /*
733- * Ignore call from super constructor (as well as any other calls
734- * unfortunate enough to be passing 0). It's critical that we
735- * ignore call from superclass constructor, as digest has not
736- * yet been initialized at that point.
733+ * Ignore call from super constructor as well as any other calls
734+ * unfortunate enough to be passing 0. All SecureRandom
735+ * constructors call `super(0)` which leads to `setSeed(0)`.
736+ * We either keep the object unseeded (in `new SecureRandom()`)
737+ * or we seed the object explicitly (in `new SecureRandom(byte[])`).
737738 */
738739 if (seed != 0 ) {
739740 setSeed (longToByteArray (seed ));
You can’t perform that action at this time.
0 commit comments