You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2016/06/29 03:24:45 UTC

[jira] [Commented] (GROOVY-5426) ObjectRange.iterator() is reliant on size()

    [ https://issues.apache.org/jira/browse/GROOVY-5426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15354468#comment-15354468 ] 

Paul King commented on GROOVY-5426:
-----------------------------------

PR#143 proposed a reasonably elegant solution to this, so I'll close this. As a result, [1, 2] is the result for your above expression.

> ObjectRange.iterator() is reliant on size()
> -------------------------------------------
>
>                 Key: GROOVY-5426
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5426
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-jdk
>    Affects Versions: 1.8.6
>            Reporter: Tim Yates
>             Fix For: 2.5.0-beta-1
>
>
> Currently the ObjectRange iterator is reliant on the size of the range.
> If the range is made up of BigInteger or BigDecimal, would it be possible to safely change this to call increment or decrement on a current internal value until it reaches its destination?
> The problem is exhibited by:
> {code}
> assert [] == (1.0G..2147483648.0G).iterator().take( 2 ).collect()
> {code}
> Where I would expect {{[1, 2]}}
> The problem is that size (being an int) for this range is -2147483648



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)