Hi
In the code below
public NumericSpinnerData(int lowerBound, int upperBound, int
increment) {
if (lowerBound >= upperBound) {
throw new IllegalArgumentException("Lower bound must be less
than upper bound.");
}
long length = ((upperBound - lowerBound) / increment) + 1;
>> if (length > Integer.MAX_VALUE) {
>> throw new IllegalArgumentException("Bounded range is too
large.");
>> }
this.lowerBound = lowerBound;
this.upperBound = upperBound;
this.increment = increment;
}
The "if" statement marked by ">>" can never trigger because when you
divide an "int" by another "int", the answer is by definition less than
Integer.MAX_VALUE.
Perhaps this code was intended for use in a floating point spinner model
class? (which is something that we're missing, BTW).
Regards, Noel.