You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2022/06/29 11:09:16 UTC

[commons-crypto] branch master updated: Documentation corrections

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
     new 4fe3ef6  Documentation corrections
4fe3ef6 is described below

commit 4fe3ef6a82bde39a5f0ddc20776c4cf1de9b2331
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jun 29 12:09:06 2022 +0100

    Documentation corrections
---
 .../org/apache/commons/crypto/random/OpenSslCryptoRandom.java    | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java b/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java
index 1cc18b6..33e2140 100644
--- a/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java
+++ b/src/main/java/org/apache/commons/crypto/random/OpenSslCryptoRandom.java
@@ -123,7 +123,7 @@ class OpenSslCryptoRandom extends Random implements CryptoRandom {
      *         random bits (right justified, with leading zeros).
      */
     @Override
-    final protected int next(final int numBits) {
+    protected final int next(final int numBits) {
         Utils.checkArgument(numBits >= 0 && numBits <= 32);
         final int numBytes = (numBits + 7) / 8;
         final byte[] b = new byte[numBytes];
@@ -139,6 +139,7 @@ class OpenSslCryptoRandom extends Random implements CryptoRandom {
 
     /**
      * Generates a user-specified number of random bytes. It's thread-safe.
+     * Overrides {@link Random}. 
      *
      * @param bytes the array to be filled in with random bytes.
      */
@@ -152,13 +153,13 @@ class OpenSslCryptoRandom extends Random implements CryptoRandom {
     }
 
     /**
-     * Overrides {@link OpenSslCryptoRandom}. For {@link OpenSslCryptoRandom},
-     * we don't need to set seed.
+     * Overrides {@link Random} (which is synchronized).
+     * We don't need to set seed for this class.
      *
      * @param seed the initial seed.
      */
     @Override
-    public void setSeed(final long seed) {
+    public synchronized void setSeed(final long seed) {
         // Self-seeding.
     }
 }