You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by jt1796 <gi...@git.apache.org> on 2016/10/06 23:56:59 UTC

[GitHub] groovy pull request #440: Groovy-7961 : NoSuchElementException

GitHub user jt1796 opened a pull request:

    https://github.com/apache/groovy/pull/440

    Groovy-7961 : NoSuchElementException

    https://issues.apache.org/jira/browse/GROOVY-7961
    
    This is a similar PR to 
    https://github.com/apache/groovy/pull/412

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jt1796/groovy object-range-exception

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/440.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #440
    
----
commit 6e771ebe9ff24e73ba85f8c83ff3ef1f9081f716
Author: John Tompkins <to...@gmail.com>
Date:   2016-10-06T03:25:24Z

    Merge pull request #1 from apache/master
    
    update

commit 317c625463169e36f9f1100b1becbd46806eaaee
Author: John Tompkins <to...@gmail.com>
Date:   2016-10-06T23:54:58Z

    do not return null when exhausted

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #440: Groovy-7961 : NoSuchElementException

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/440


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #440: Groovy-7961 : NoSuchElementException

Posted by jt1796 <gi...@git.apache.org>.
Github user jt1796 commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/440#discussion_r82318447
  
    --- Diff: src/main/groovy/lang/ObjectRange.java ---
    @@ -450,6 +451,9 @@ public Comparable next() {
                     value = peek();
                     nextFetched = true;
                 }
    +            if (value == null) {
    +                throw new NoSuchElementException();
    +            }
    --- End diff --
    
    Thanks, much better.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #440: Groovy-7961 : NoSuchElementException

Posted by jwagenleitner <gi...@git.apache.org>.
Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/440#discussion_r82316120
  
    --- Diff: src/main/groovy/lang/ObjectRange.java ---
    @@ -450,6 +451,9 @@ public Comparable next() {
                     value = peek();
                     nextFetched = true;
                 }
    +            if (value == null) {
    +                throw new NoSuchElementException();
    +            }
    --- End diff --
    
    I think these first 2 `if` statements could be replaced by the following and would make it cleaner:
    ```
    if (!hasNext()) {
        throw new NoSuchElementException();
    }
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---