Ensure tieBreaker is positive (#71)
Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
This commit is contained in:
parent
164ca04236
commit
7312077fd9
@ -315,7 +315,7 @@ public class Agent
|
|||||||
new BigInteger(128, random).toString(32),
|
new BigInteger(128, random).toString(32),
|
||||||
/* min */ 22, /* max */ 256);
|
/* min */ 22, /* max */ 256);
|
||||||
|
|
||||||
tieBreaker = Math.abs(random.nextLong());
|
tieBreaker = random.nextLong() & 0x7FFFFFFFFFFFFFFFL;
|
||||||
nominator = new DefaultNominator(this);
|
nominator = new DefaultNominator(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user