Github user paulk-asert commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/360#discussion_r70180536
  
    --- Diff: src/main/groovy/lang/ObjectRange.java ---
    @@ -518,25 +496,41 @@ private T peek() {
         }
     
         /**
    -     * Increments by one
    +     * Increments by step size
          *
          * @param value the value to increment
    -     * @return the incremented value
    +     * @param step  the value to increment by
    +     * @return the incremented value or null, if there isn't any
          */
         @SuppressWarnings("unchecked")
    -    private T increment(T value) {
    -        return (T) InvokerHelper.invokeMethod(value, "next", null);
    +    private T increment(T value, int step) {
    +        for (int i = 0; i < step; i++) {
    +            final T next = (T) InvokerHelper.invokeMethod(value, "next", 
null);
    +            if (!compareGreaterThan(next, value)) /* e.g. `next` of the 
last element */ {
    +                return null;
    +            }
    +            value = next;
    +        }
    +        return value;
         }
     
         /**
    -     * Decrements by one
    +     * Decrements by step size
          *
          * @param value the value to decrement
    -     * @return the decremented value
    +     * @param step  the value to decrement by
    +     * @return the decremented value or null, if there isn't any
          */
         @SuppressWarnings("unchecked")
    -    private T decrement(T value) {
    --- End diff --
    
    I'd like to see this rebased. That would help me understand whether we have 
broken binary compatibility.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to