Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-720

DBCursor.next() throws the wrong Exception

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.11.0
    • Affects Version/s: 2.10.1
    • Component/s: 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 Unassigned
            Reporter:
            seanjreilly Sean Reilly
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: