cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [08/34] git commit: updated refs/heads/master to 7a57ce3
Date Mon, 15 Jun 2015 09:14:41 GMT
Fix findbugs DMI_RANDOM_USED_ONLY_ONCE warning in ServerTransportProvider.java Changed to recommended
SecureRandom instead of Random Moved initializers to constructor

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #415


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4e0fe469
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4e0fe469
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4e0fe469

Branch: refs/heads/master
Commit: 4e0fe469dde4053a5d60b93df90ec8bd4dea8941
Parents: 16baa12
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Sun Jun 14 16:22:08 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Jun 15 12:09:20 2015 +0300

----------------------------------------------------------------------
 .../cloudstack/framework/server/ServerTransportProvider.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4e0fe469/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
----------------------------------------------------------------------
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
b/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
index 0fb8141..ba8750b 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/server/ServerTransportProvider.java
@@ -20,7 +20,7 @@ package org.apache.cloudstack.framework.server;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Random;
+import java.security.SecureRandom;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -47,12 +47,14 @@ public class ServerTransportProvider implements TransportProvider {
     private Map<String, TransportEndpointSite> _endpointMap = new HashMap<String,
TransportEndpointSite>();
     private int _poolSize = DEFAULT_WORKER_POOL_SIZE;
     private ExecutorService _executor;
-
-    private int _nextEndpointId = new Random().nextInt();
+    private final SecureRandom randomGenerator;
+    private int _nextEndpointId;
 
     private MessageSerializer _messageSerializer;
 
     public ServerTransportProvider() {
+       randomGenerator=new SecureRandom();
+       _nextEndpointId=randomGenerator.nextInt();
     }
 
     public String getNodeId() {


Mime
View raw message