In the class RandomValuePropertySource, we have the following code:
private long getNextLongInRange(String range) {
String[] tokens = StringUtils.commaDelimitedListToStringArray(range);
if (tokens.length == 1) {
// divisor may be zero here!
return Math.abs(getSource().nextLong() % Long.parseLong(tokens[0]));
}
long lowerBound = Long.parseLong(tokens[0]);
long upperBound = Long.parseLong(tokens[1]) - lowerBound;
// divisor may be zero here!
return lowerBound + Math.abs(getSource().nextLong() % upperBound);
}
If the string tokens parsed from range contain 0 or tokens[0].equals(tokens[1]), we will encounter two divide by zero problems in the above code.