You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mnemonic.apache.org by "Jaechang Nam (JIRA)" <ji...@apache.org> on 2017/01/09 17:50:58 UTC
[jira] [Updated] (MNEMONIC-180) Missing throw for
NoSuchElementException();
[ https://issues.apache.org/jira/browse/MNEMONIC-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jaechang Nam updated MNEMONIC-180:
----------------------------------
Description:
In recent snapshot, it seems there is an exception (new NoSuchElementException) that is not thrown. (mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedList.java)
{code}
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 }
{code}
Should it be as follows?
{code}
...
164 if (null == next) {
165 throw new NoSuchElementException();
166 }
...
{code}
was:
In recent snapshot, it seems there is an exception (new NoSuchElementException) that is not thrown. (mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedList.java)
{code}
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 }
{code}
Should it be
{code}
...
164 if (null == next) {
165 throw new NoSuchElementException();
166 }
...
{code}
> Missing throw for NoSuchElementException();
> -------------------------------------------
>
> Key: MNEMONIC-180
> URL: https://issues.apache.org/jira/browse/MNEMONIC-180
> Project: Mnemonic
> Issue Type: Bug
> Reporter: Jaechang Nam
> Priority: Trivial
>
> In recent snapshot, it seems there is an exception (new NoSuchElementException) that is not thrown. (mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedList.java)
> {code}
> 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 }
> {code}
> Should it be as follows?
> {code}
> ...
> 164 if (null == next) {
> 165 throw new NoSuchElementException();
> 166 }
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)