From 4c269c3167e6a5898d37c12eadef54c6124698c2 Mon Sep 17 00:00:00 2001 From: leventov Date: Mon, 19 Jan 2015 07:07:21 +0700 Subject: [PATCH] Fixed a bug in AbstractChronicleMap.EntryIterator -- shouldn't update iterator's state on next(), if there no more entries --- .../java/net/openhft/chronicle/map/AbstractChronicleMap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java index c4665bea3..c9bdaac4b 100644 --- a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java @@ -318,9 +318,10 @@ abstract class AbstractChronicleMap extends AbstractMap public Entry next() { checkSingleThreaded(); fillEntryBuffer(); - if ((returned = entryBuffer.poll()) == null) + Entry e; + if ((e = entryBuffer.poll()) == null) throw new NoSuchElementException(); - return returned; + return returned = e; } @Override