commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1789013 - /commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
Date Mon, 27 Mar 2017 21:15:43 GMT
Author: sebb
Date: Mon Mar 27 21:15:43 2017
New Revision: 1789013

URL: http://svn.apache.org/viewvc?rev=1789013&view=rev
Log:
Pull Random instance creation out of loop

Modified:
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java?rev=1789013&r1=1789012&r2=1789013&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
Mon Mar 27 21:15:43 2017
@@ -54,9 +54,11 @@ public class PureJavaCrc32Test {
 
     checkOnBytes("hello world!".getBytes("UTF-8"), false);
 
+    final Random random1 = new Random();
+    final Random random2 = new Random();
     for (int i = 0; i < 10000; i++) {
-      byte randomBytes[] = new byte[new Random().nextInt(2048)];
-      new Random().nextBytes(randomBytes);
+      byte randomBytes[] = new byte[random1.nextInt(2048)];
+      random2.nextBytes(randomBytes);
       checkOnBytes(randomBytes, false);
     }
 



Mime
View raw message