On 03/14/2014 08:05 AM, Ivan Gerasimov wrote:
One thing I noticed is that some methods I mentioned above (List.subList(), Arrays.sort(), etc) throw IllegalArgumentException when fromIndex > toIndex, not IndexOutOfBoundException.Wouldn't it be more correct to adopt this into removeRange() too?
The question is, what exception should be thrown for removeRange(0, -1) then... The order of checks matters and should be specified if two kinds of exceptions are thrown...
Regards, Peter