From 4ca797401ebc64542194887137ea740b61bed123 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 6 Jun 2007 10:36:04 +0000 Subject: [PATCH] fix for ConcurrentModificationException see http://www.yacy-forum.de/viewtopic.php?p=36566#36566 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3800 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../de/anomic/plasma/plasmaWebStructure.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/plasma/plasmaWebStructure.java b/source/de/anomic/plasma/plasmaWebStructure.java index db61e6b95..7bd9447dd 100644 --- a/source/de/anomic/plasma/plasmaWebStructure.java +++ b/source/de/anomic/plasma/plasmaWebStructure.java @@ -29,6 +29,7 @@ package de.anomic.plasma; import java.io.File; import java.io.IOException; +import java.util.ConcurrentModificationException; import java.util.Date; import java.util.Iterator; import java.util.Map; @@ -222,12 +223,19 @@ public class plasmaWebStructure { public String resolveDomHash2DomString(String domhash) { // returns the domain as string, null if unknown assert domhash.length() == 6; - SortedMap tailMap = structure.tailMap(domhash); - if ((tailMap == null) || (tailMap.size() == 0)) return null; - String key = (String) tailMap.firstKey(); - if (key.startsWith(domhash)) { - return key.substring(7); - } else { + try { + SortedMap tailMap = structure.tailMap(domhash); + if ((tailMap == null) || (tailMap.size() == 0)) return null; + String key = (String) tailMap.firstKey(); + if (key.startsWith(domhash)) { + return key.substring(7); + } else { + return null; + } + } catch (ConcurrentModificationException e) { + // we dont want to implement a synchronization here, + // because this is 'only' used for a graphics application + // just return null return null; } }