cloudstack-commits mailing list archives

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

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

This closes #416


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

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

----------------------------------------------------------------------
 .../apache/cloudstack/framework/transport/TransportAddress.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89a07084/framework/ipc/src/org/apache/cloudstack/framework/transport/TransportAddress.java
----------------------------------------------------------------------
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/transport/TransportAddress.java
b/framework/ipc/src/org/apache/cloudstack/framework/transport/TransportAddress.java
index 4a724fd..99e25b1 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/transport/TransportAddress.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/transport/TransportAddress.java
@@ -19,7 +19,7 @@
 
 package org.apache.cloudstack.framework.transport;
 
-import java.util.Random;
+import java.security.SecureRandom;
 
 public class TransportAddress {
     public final static String LOCAL_SERVICE_NODE = "";
@@ -29,6 +29,7 @@ public class TransportAddress {
     private int _connectionId = LOCAL_SERVICE_CONNECTION;
     private String _endpointId;
     private int _magic;
+    private final SecureRandom randomGenerator=new SecureRandom();
 
     public TransportAddress(String nodeId, int connectionId, String endpointId) {
         assert (nodeId != null);
@@ -39,7 +40,7 @@ public class TransportAddress {
         _nodeId = nodeId;
         _connectionId = connectionId;
         _endpointId = endpointId;
-        _magic = new Random().nextInt();
+        _magic = randomGenerator.nextInt();
     }
 
     public TransportAddress(String nodeId, int connectionId, String endpointId, int magic)
{


Mime
View raw message