activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [activemq] branch master updated: [AMQ-7199] Replace Math.Random with Random.nextDouble
Date Mon, 19 Aug 2019 17:29:05 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new ca77f9c  [AMQ-7199] Replace Math.Random with Random.nextDouble
     new fb7d4e6  Merge pull request #357 from bd2019us/AMQ-7199
ca77f9c is described below

commit ca77f9cfc9135c5cf7fbb91c0d4ccbf95ca44b59
Author: bd2019us <>
AuthorDate: Fri May 10 21:39:53 2019 -0500

    [AMQ-7199] Replace Math.Random with Random.nextDouble
---
 assembly/src/release/examples/openwire/ecommerce/src/Retailer.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java b/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java
index 01ecfef..5b76459 100644
--- a/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java
+++ b/assembly/src/release/examples/openwire/ecommerce/src/Retailer.java
@@ -24,6 +24,7 @@ import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TemporaryQueue;
 
+import java.util.Random;
 /**
  * The Retailer orders computers from the Vendor by sending a message via
  * the VendorOrderQueue. It then syncronously receives the reponse message
@@ -58,7 +59,8 @@ public class Retailer implements Runnable {
 			for (int i = 0; i < 5; i++) {
 				MapMessage message = session.createMapMessage();
 				message.setString("Item", "Computer(s)");
-				int quantity = (int)(Math.random() * 4) + 1;
+				Random rand = new Random();
+				int quantity = (int)(rand.nextDouble() * 4) + 1;
 				message.setInt("Quantity", quantity);
 				message.setJMSReplyTo(retailerConfirmQueue);
 				producer.send(message);


Mime
View raw message