On Jan 31, 2014, at 5:23 PM, Chris Hegarty <[email protected]> wrote:
> Trivial change to CopyOnWriteArrayList.COWSubList.subList to catch the case
> where the fromIndex is greater that the toIndex.
>
> http://cr.openjdk.java.net/~chegar/8011645/webrev.00/webrev/
>
Looks ok to me.
--
Shame it's awkward to share this code from ArrayList:
static void subListRangeCheck(int fromIndex, int toIndex, int size) {
if (fromIndex < 0)
throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
if (toIndex > size)
throw new IndexOutOfBoundsException("toIndex = " + toIndex);
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex +
") > toIndex(" + toIndex + ")");
}
Paul.