Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copyToArray is broken #6827

Closed
scabug opened this issue Dec 18, 2012 · 3 comments
Closed

copyToArray is broken #6827

scabug opened this issue Dec 18, 2012 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 18, 2012

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.

@scabug
Copy link
Author

scabug commented Dec 18, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6827?orig=1
Reporter: @non

@scabug
Copy link
Author

scabug commented Jan 4, 2013

@adriaanm said:
scala/scala#1785

@scabug
Copy link
Author

scabug commented Jan 4, 2013

@adriaanm said:
2.10.1-RC1: scala/scala#1841

@scabug scabug closed this as completed Jan 4, 2013
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants