groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-5426) ObjectRange.iterator() is reliant on size()
Date Wed, 29 Jun 2016 03:24:45 GMT

    [ 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)

Mime
View raw message