style: include IT_NO_SUCH_ELEMENT (#5200)

This commit is contained in:
Piotr Idzik
2024-06-04 22:54:38 +02:00
committed by GitHub
parent f3db699083
commit 493942e319
2 changed files with 5 additions and 5 deletions

View File

@ -77,9 +77,6 @@
<Match> <Match>
<Bug pattern="UWF_UNWRITTEN_FIELD" /> <Bug pattern="UWF_UNWRITTEN_FIELD" />
</Match> </Match>
<Match>
<Bug pattern="IT_NO_SUCH_ELEMENT" />
</Match>
<Match> <Match>
<Bug pattern="DLS_DEAD_LOCAL_STORE" /> <Bug pattern="DLS_DEAD_LOCAL_STORE" />
</Match> </Match>

View File

@ -148,9 +148,12 @@ public class LinkedQueue<T> implements Iterable<T> {
@Override @Override
public T next() { public T next() {
if (hasNext()) {
node = node.next; node = node.next;
return node.data; return node.data;
} }
throw new NoSuchElementException();
}
}; };
} }