--- old/src/share/classes/java/util/ArrayList.java 2014-03-13 22:55:41.407770448 +0400 +++ new/src/share/classes/java/util/ArrayList.java 2014-03-13 22:55:40.871777187 +0400 @@ -609,12 +609,14 @@ * @throws IndexOutOfBoundsException if {@code fromIndex} or * {@code toIndex} is out of range * ({@code fromIndex < 0 || - * fromIndex >= size() || * toIndex > size() || * toIndex < fromIndex}) */ protected void removeRange(int fromIndex, int toIndex) { modCount++; + if (fromIndex > toIndex) + throw new IndexOutOfBoundsException( + "From Index: " + fromIndex + " > To Index: " + toIndex); int numMoved = size - toIndex; System.arraycopy(elementData, toIndex, elementData, fromIndex, numMoved);