You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by rs...@apache.org on 2019/12/29 16:59:44 UTC

[httpcomponents-core] 01/02: ReactiveTestUtils: Fix reproducibility

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

rschmitt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 1d49b3886b25d4e98f18bf3f5fd51892c049ab9f
Author: Ryan Schmitt <rs...@pobox.com>
AuthorDate: Sat Dec 28 20:19:21 2019 -0500

    ReactiveTestUtils: Fix reproducibility
---
 .../java/org/apache/hc/core5/testing/reactive/ReactiveTestUtils.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/reactive/ReactiveTestUtils.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/reactive/ReactiveTestUtils.java
index 3b67f52..6a6bed3 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/reactive/ReactiveTestUtils.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/reactive/ReactiveTestUtils.java
@@ -102,7 +102,7 @@ public class ReactiveTestUtils {
                     final int bufferLength = (int) Math.min(remainingLength, 1 + random.nextInt(maximumBlockSize));
                     final byte[] bs = new byte[bufferLength];
                     for (int i = 0; i < bufferLength; i++) {
-                        final byte b = RANGE[(int) (Math.random() * RANGE.length)];
+                        final byte b = RANGE[(int) (random.nextDouble() * RANGE.length)];
                         bs[i] = b;
                     }
                     if (hash != null) {