From dd8b9956c7f3a10b141e26ccd8b14c79ddb619a9 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Thu, 12 Apr 2018 11:43:49 +0530 Subject: Used secure random number generation Issue-ID: CCSDK-184 Change-Id: I00719fb778a6ab7dc964bb1e4710a9014ba51fcd Signed-off-by: prakash.e --- .../org/onap/ccsdk/sli/adaptors/lock/comp/SynchronizedFunction.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'resource-assignment') diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/SynchronizedFunction.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/SynchronizedFunction.java index f4df81b8b..9cce17a46 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/SynchronizedFunction.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/SynchronizedFunction.java @@ -21,6 +21,7 @@ package org.onap.ccsdk.sli.adaptors.lock.comp; +import java.security.SecureRandom; import java.util.Collection; import java.util.HashSet; import java.util.Set; @@ -51,6 +52,7 @@ public abstract class SynchronizedFunction { } private static String generateLockRequester() { - return "SynchronizedFunction-" + (int) (Math.random() * 1000000); + SecureRandom rand = new SecureRandom(); + return "SynchronizedFunction-" + (int) (rand.nextDouble() * 1000000); } } -- cgit 1.2.3-korg