Files
2025-02-05 04:43:28 +00:00

15 lines
565 B
HTML

<html>
<body>
Reports implementations of <code>Iterator.hasNext()</code> or <code>ListIterator.hasPrevious()</code> that call
<code>Iterator.next()</code> or <code>ListIterator.previous()</code> on the iterator instance. Such calls are almost certainly an error, as methods
like <code>hasNext()</code> should not modify the iterators state, while <code>next()</code> should.
<p><b>Example:</b></p>
<pre><code>
class MyIterator implements Iterator&lt;Integer&gt; {
public boolean hasNext() {
return next() != null;
}
}
</code></pre>
</body>
</html>