[
https://issues.apache.org/jira/browse/GROOVY-9969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sean Fitts updated GROOVY-9969:
-------------------------------
Priority: Major (was: Minor)
> Use of a negative range with Long values results in reversed sequence
> ---------------------------------------------------------------------
>
> Key: GROOVY-9969
> URL: https://issues.apache.org/jira/browse/GROOVY-9969
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 2.5.12, 2.5.14
> Reporter: Sean Fitts
> Priority: Major
>
> Use of long values when describing an array range results in a reserved
> result when it should not.
> For example, the following is true in 2.5.11 and false starting in 2.5.12:
> {code:java}
> [1L, 2L, 3L, 4L, 5L, 6L][(2L .. -2L)] == [3L, 4L, 5L]
> {code}
> The following however is true in all versions of 2.5:
> {code:java}
> [1L, 2L, 3L, 4L, 5L, 6L][(2 .. -2)] == [3L, 4L, 5L]
> {code}
> I believe this bug was introduced in the fix for
> https://issues.apache.org/jira/browse/GROOVY-8966. The NumberRange produced
> reverses the from and to resulting in the reversed sequence.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)