Skip to content

copyToArray is broken #6827

Closed
Closed

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.

Activity

  1. scabug commented on Dec 18, 2012

    @scabug
    Author
  2. scabug commented on Jan 4, 2013

    @scabug
    Author
  3. scabug commented on Jan 4, 2013

    @scabug
    Author

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

  4. added this to the 2.10.1 milestone on Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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