Fixed a bug in AbstractChronicleMap.EntryIterator -- shouldn't update iterator's state on next(), if there no more entries

This commit is contained in:
leventov
2015-01-19 07:07:21 +07:00
parent 4af4fce33c
commit 4c269c3167
@@ -318,9 +318,10 @@ abstract class AbstractChronicleMap<K, V> extends AbstractMap<K, V>
public Entry<K, V> next() {
checkSingleThreaded();
fillEntryBuffer();
if ((returned = entryBuffer.poll()) == null)
Entry<K, V> e;
if ((e = entryBuffer.poll()) == null)
throw new NoSuchElementException();
return returned;
return returned = e;
}
@Override