mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
15 lines
565 B
HTML
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<Integer> {
|
|
public boolean hasNext() {
|
|
return next() != null;
|
|
}
|
|
}
|
|
</code></pre>
|
|
</body>
|
|
</html> |