AMQ-4826: Failover transport - avoid floating-point issue on other JDKs.

This commit is contained in:
Claus Ibsen 2013-11-03 11:00:03 +01:00
parent a6c14b4181
commit 06356db1c4
1 changed files with 2 additions and 1 deletions

View File

@ -776,7 +776,8 @@ public class FailoverTransport implements CompositeTransport {
if (randomize) {
// Randomly, reorder the list by random swapping
for (int i = 0; i < l.size(); i++) {
int p = (int) (Math.random() * 100 % l.size());
// meed parenthesis due other JDKs (see AMQ-4826)
int p = ((int) (Math.random() * 100)) % l.size();
URI t = l.get(p);
l.set(p, l.get(i));
l.set(i, t);