From 76619953a628e8c6d3792872a3456260a58d9ffc Mon Sep 17 00:00:00 2001 From: Rex Kerr Date: Sun, 24 Aug 2014 15:51:33 -0700 Subject: SI-7128 copyToArray(xs, 0, 0) should not fail Fixed all copyToArray methods to do exactly what the docs say they do, with the least-suprise behavior of not throwing an exception if you ask to copy nothing (but would have copied out of range). Iterator had an undocumented requirement for the target index to be in range regardless if anything happened; this has been removed. --- test/files/run/t6827.check | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/files/run/t6827.check') diff --git a/test/files/run/t6827.check b/test/files/run/t6827.check index 3a3a71c67d..4889e05be8 100644 --- a/test/files/run/t6827.check +++ b/test/files/run/t6827.check @@ -1,6 +1,6 @@ -start at -5: java.lang.IllegalArgumentException: requirement failed: start -5 out of range 10 -start at -1: java.lang.IllegalArgumentException: requirement failed: start -1 out of range 10 -start at limit: java.lang.IllegalArgumentException: requirement failed: start 10 out of range 10 +start at -5: java.lang.ArrayIndexOutOfBoundsException: -5 +start at -1: java.lang.ArrayIndexOutOfBoundsException: -1 +start at limit: ok start at limit-1: ok first 10: ok read all: ok @@ -8,8 +8,8 @@ test huge len: ok 5 from 5: ok 20 from 5: ok test len overflow: ok -start beyond limit: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 +start beyond limit: ok read 0: ok read -1: ok -invalid read 0: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 -invalid read -1: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 +invalid read 0: ok +invalid read -1: ok -- cgit v1.2.3