From 3ef77d2030e95d1256a61f5a5e7feb0b5ae62f17 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 9 Mar 2007 12:14:25 +0000 Subject: [PATCH] fix for http://www.yacy-forum.de/viewtopic.php?p=29878#29878 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3461 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../anomic/kelondro/kelondroMapObjects.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroMapObjects.java b/source/de/anomic/kelondro/kelondroMapObjects.java index 8e564d2f8..d455f57ab 100644 --- a/source/de/anomic/kelondro/kelondroMapObjects.java +++ b/source/de/anomic/kelondro/kelondroMapObjects.java @@ -333,16 +333,20 @@ public class kelondroMapObjects extends kelondroObjects { } public Object next() { - final String nextKey = (String) keyIterator.next(); - if (nextKey == null) { - finish = true; - return null; + String nextKey; + Map map; + while (keyIterator.hasNext()) { + nextKey = (String) keyIterator.next(); + if (nextKey == null) { + finish = true; + return null; + } + map = getMap(nextKey); + if (map == null) continue; // circumvention of a modified exception + map.put("key", nextKey); + return map; } - final Map map = getMap(nextKey); - //assert (map != null) : "nextKey = " + nextKey; - if (map == null) throw new kelondroException("no more elements available"); - map.put("key", nextKey); - return map; + throw new kelondroException("no more elements available"); } public void remove() {