DBCursor.next() throws the wrong Exception

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.11.0
    • Affects Version/s: 2.10.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The contract for java.util.Iterator specifies that next() should throw a NoSuchElementException "if the iteration has no more elements". Instead, the java driver throws a RuntimeException. See http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html#next() for more details.

      Backwards compatibility: IMO, this can be fixed without backwards compatibility concerns, because NoSuchElementException is a subclass of RuntimeException.

            Assignee:
            Unassigned
            Reporter:
            Sean Reilly
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: