You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2024/01/23 22:39:00 UTC

[jira] [Created] (GROOVY-11296) shuffled modifies input array

Eric Milles created GROOVY-11296:
------------------------------------

             Summary: shuffled modifies input array
                 Key: GROOVY-11296
                 URL: https://issues.apache.org/jira/browse/GROOVY-11296
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 4.0.0, 3.0.0, 5.x
            Reporter: Eric Milles
            Assignee: Eric Milles


{code:groovy}
Integer[] array = [10, 5, 20]
def result = array.shuffled()
assert array !== result
assert array.size() == result.size()
assert array.every{ result.contains(it) }
assert array == new Integer[] {10, 5, 20} // fails!
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)