Skip to content

copyToArray is broken #6827

@scabug

Description

@scabug

The limit calculation used to determine when to end the loop is wrong, and will result in an ArrayIndexOutOfBoundsException for a non-zero start. This was pointed out in #scala tonight (possibly earlier).

This patch adds test cases to handle this situation, as well as a situation where start itself exceed the array length. I elected not to add checks for negative start and length parameters, although these could easily be added.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions