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 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 scabug commented Dec 18, 2012

Loading

@scabug
Copy link
Author

@scabug scabug commented Jan 4, 2013

Loading

@scabug
Copy link
Author

@scabug scabug commented Jan 4, 2013

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

Loading

@scabug scabug closed this 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants