Affects Version/s: 1.1
Fix Version/s: 1.2
RandomDataImpl.nextInt(Integer.MIN_VALUE, Integer.MAX_VALUE) suffers from overflow errors.
return lower + (int) (rand.nextDouble() * (upper - lower + 1));
return (int) (lower + (long) (rand.nextDouble()*((long) upper - lower + 1)));
additional checks must be made for the nextlong(long, long) method.
At first I thought about using MathUtils.subAndCheck(long, long) but there is only an int version avalible, and the problem is that subAndCheck internaly uses long values to check for overflow just as my previous channge proposes. The only thing I can think of is using a BigInteger to check for the number of bits required to express the difference.