diff options
author | Soumendu Sekhar Acharya <sa00498080@techmahindra.com> | 2017-12-05 13:46:11 +0530 |
---|---|---|
committer | Soumendu Sekhar Acharya <sa00498080@techmahindra.com> | 2017-12-05 13:46:11 +0530 |
commit | 6437317480713c7d5d9295d1509abe39a0dbfe19 (patch) | |
tree | f0083b42c31e22677d7e6219a76a64b31146a71f /src | |
parent | 78d09a8c2ed502b15725d83c69179ac97d62b24e (diff) |
Critical For Use the original value instead
Checked non zero
Sonar Link:
https://sonar.onap.org/component_issues/index?id=org.onap.dmaap.messagerouter.dmaapclient%3AdmaapClient#resolved=false|assignees=soumendu|severities=CRITICAL
Location:
src/main/java/com/att/nsa/mr/client/HostSelector.java
Line No-146
Change-Id: I58a059b919984d9b430878b1737a5a792e8f6bb0
Issue-ID: DMAAP-177
Signed-off-by: Soumendu Sekhar Acharya <sa00498080@techmahindra.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/att/nsa/mr/client/HostSelector.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/att/nsa/mr/client/HostSelector.java b/src/main/java/com/att/nsa/mr/client/HostSelector.java index 7e92bd8..5a77244 100644 --- a/src/main/java/com/att/nsa/mr/client/HostSelector.java +++ b/src/main/java/com/att/nsa/mr/client/HostSelector.java @@ -144,8 +144,12 @@ public class HostSelector } else { + int index = 0; + int value = new Random().nextInt(); Vector v = new Vector(workingSet); - int index = Math.abs(new Random().nextInt()) % workingSet.size(); + if(value!=0) { + index = Math.abs(value) % workingSet.size(); + } selection = (String)v.elementAt(index); } |