From 8e56c2ace6cbadcbe7aaabf90ce02812174633d7 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 7 Aug 2009 22:53:49 +0000 Subject: [PATCH] fix for fixes from this afternoon git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6253 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../anomic/crawler/retrieval/LoaderDispatcher.java | 2 +- source/de/anomic/kelondro/blob/MapView.java | 12 +++++++----- source/de/anomic/kelondro/index/SimpleARC.java | 14 ++++++++------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/source/de/anomic/crawler/retrieval/LoaderDispatcher.java b/source/de/anomic/crawler/retrieval/LoaderDispatcher.java index 398d89ec9..4fddfabcd 100644 --- a/source/de/anomic/crawler/retrieval/LoaderDispatcher.java +++ b/source/de/anomic/crawler/retrieval/LoaderDispatcher.java @@ -109,7 +109,7 @@ public final class LoaderDispatcher { final yacyURL url, final boolean forText, final boolean global - ) throws IOException { + ) { return new Request( sb.peers.mySeed().hash, url, diff --git a/source/de/anomic/kelondro/blob/MapView.java b/source/de/anomic/kelondro/blob/MapView.java index eaedeba45..72dfad79f 100644 --- a/source/de/anomic/kelondro/blob/MapView.java +++ b/source/de/anomic/kelondro/blob/MapView.java @@ -135,14 +135,16 @@ public class MapView { * @throws IOException */ public void put(String key, final Map newMap) throws IOException { - assert (key != null); - assert (key.length() > 0); - assert (newMap != null); + assert key != null; + assert key.length() > 0; + assert newMap != null; key = normalizeKey(key); - + assert blob != null; synchronized (this) { // write entry - blob.put(key.getBytes("UTF-8"), map2string(newMap, "W" + DateFormatter.formatShortSecond() + " ").getBytes("UTF-8")); + String s = map2string(newMap, "W" + DateFormatter.formatShortSecond() + " "); + assert s != null; + blob.put(key.getBytes("UTF-8"), s.getBytes("UTF-8")); // write map to cache cache.put(key, newMap); diff --git a/source/de/anomic/kelondro/index/SimpleARC.java b/source/de/anomic/kelondro/index/SimpleARC.java index 7e7231591..5a8795d05 100644 --- a/source/de/anomic/kelondro/index/SimpleARC.java +++ b/source/de/anomic/kelondro/index/SimpleARC.java @@ -62,16 +62,18 @@ public class SimpleARC { } /** - * put a value to the cache. The value may NOT exist before. - * This restriction is used here to check possible algorithm logic error cases. + * put a value to the cache. * @param s * @param v */ public void put(K s, V v) { - assert this.levelA.get(s) == null; - assert this.levelB.get(s) == null; - this.levelA.put(s, v); - assert (this.levelA.size() <= cacheSize); // the cache should shrink automatically + if (this.levelB.containsKey(s)) { + this.levelB.put(s, v); + assert (this.levelB.size() <= cacheSize); // the cache should shrink automatically + } else { + this.levelA.put(s, v); + assert (this.levelA.size() <= cacheSize); // the cache should shrink automatically + } } /**