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

DBCursor.next() throws the wrong Exception

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.11.0
    • 2.10.1
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            seanjreilly Sean Reilly
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: