scala/scala — pull request #1785 by non (2012-12-18 04:36:07+00:00)
Title: Fix Iterator#copyToArray (fixes SI-6827).

As pointed out in #scala, when using a non-zero start it's possible
to get an ArrayIndexOutOfBoundsException due to an incorrect bounds
check. This patch fixes this, as well as another potential bounds
error, and adds test cases.

I'm not sure if this should go against 2.10 or what... I'm happy to resubmit somewhere else if necessary.