diff options
-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); } |