Change ArrayList.removeRange to not throw IOBE when from == to == size()

This is confusing behavior, but is an attempt to match Java's ArrayList.

The Javadoc says "(If toIndex==fromIndex, this operation has no effect.)"

Java 1.7.0 no-ops if fromIndex==toIndex && fromIndex >= 0 && fromIndex <= size

BUT, Java 1.7.0 throws IOBE if fromIndex == toIndex && (fromIndex < 0 ||
     fromIndex > size)

The following code snippet illustrates the behavior:

public static void main(String[] args) {
  ArrayList l = new ArrayList();
  l.add("item");
  l.removeRange(0,0); // Success
  l.removeRange(1,1); // Success
  l.removeRange(2,2); // Fail: throws IOBE
}

Change-Id: Ifb5d5998d8ddcab1a126107672e9a71f8b760fb9
Review-Link: https://gwt-review.googlesource.com/#/c/4731/
2 files changed