Uploaded image for project: 'Mnemonic'
  1. Mnemonic
  2. MNEMONIC-180

Missing throw for NoSuchElementException();

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 0.5.0-incubating
    • None
    • None

    Description

      In recent snapshot from Github, it seems there is an exception (new NoSuchElementException) that is not thrown. (mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedList.java)

      162     @Override
      163     public E next() {
      164       if (null == next) {
      165         new NoSuchElementException();
      166       }
      167       E ret = next.getItem();
      168       next = next.getNext();
      169       return ret;
      170     }
      

      Should it be as follows?

      ...
      164       if (null == next) {
      165         throw new NoSuchElementException();
      166       }
      ...
      

      Attachments

        Activity

          People

            qichfan Gordon King
            lifove JC
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: