From 2bc36de3364ba2b93eb3185e610e6ea8c61f8161 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 15 Feb 2010 22:06:13 +0000 Subject: [PATCH] - fix for bug in svn 6669 - cleanup git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6670 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/yacy/yacySeedDB.java | 8 +++-- source/net/yacy/kelondro/blob/HeapReader.java | 16 ---------- .../net/yacy/kelondro/blob/MapDataMining.java | 6 ---- source/net/yacy/kelondro/util/BDecoder.java | 30 ------------------- 4 files changed, 5 insertions(+), 55 deletions(-) diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java index bfa6f050b..9a372d7c1 100644 --- a/source/de/anomic/yacy/yacySeedDB.java +++ b/source/de/anomic/yacy/yacySeedDB.java @@ -532,11 +532,13 @@ public final class yacySeedDB implements AlternativeDomainNames { if ((this.mySeed != null) && (hash.equals(mySeed.hash))) return mySeed; ConcurrentHashMap entry = new ConcurrentHashMap(); try { - entry.putAll(database.get(hash)); + Map map = database.get(hash); + if (map == null) return null; + entry.putAll(map); } catch (final IOException e) { - entry = null; + Log.logException(e); + return null; } - if (entry == null) return null; return new yacySeed(hash, entry); } diff --git a/source/net/yacy/kelondro/blob/HeapReader.java b/source/net/yacy/kelondro/blob/HeapReader.java index 93115c3a1..1095199cf 100644 --- a/source/net/yacy/kelondro/blob/HeapReader.java +++ b/source/net/yacy/kelondro/blob/HeapReader.java @@ -602,22 +602,6 @@ public class HeapReader { } } - /* the old code: - - private Map.Entry next0() { - try { - while (true) { - int len = is.readInt(); - byte[] key = new byte[this.keylen]; - if (is.read(key) < key.length) return null; - byte[] payload = new byte[len - this.keylen]; - if (is.read(payload) < payload.length) return null; - if (key[0] == 0) continue; // this is an empty gap - return new entry(key, payload); - } - } - */ - public Map.Entry next() { final Map.Entry n = this.nextEntry; this.nextEntry = next0(); diff --git a/source/net/yacy/kelondro/blob/MapDataMining.java b/source/net/yacy/kelondro/blob/MapDataMining.java index 645b96425..bd5d27ba7 100644 --- a/source/net/yacy/kelondro/blob/MapDataMining.java +++ b/source/net/yacy/kelondro/blob/MapDataMining.java @@ -191,18 +191,12 @@ public class MapDataMining extends MapHeap { assert (key != null); assert (key.length() > 0); assert (newMap != null); - -// super.put(key, newMap); // moved down for solving yacy-bar-values - needed to be before the other stuff? -// -// // update sortCluster -// if (sortClusterMap != null) updateSortCluster(key, newMap); // update elementCount if ((longaccfields != null) || (doubleaccfields != null)) { final Map oldMap = super.get(key, false); if (oldMap != null) { // element exists, update acc - // if ((longaccfields != null) || (doubleaccfields != null)) updateAcc(oldMap, false); // we already checked this - don't we? updateAcc(oldMap, false); } diff --git a/source/net/yacy/kelondro/util/BDecoder.java b/source/net/yacy/kelondro/util/BDecoder.java index 609359810..9a9f615d6 100644 --- a/source/net/yacy/kelondro/util/BDecoder.java +++ b/source/net/yacy/kelondro/util/BDecoder.java @@ -307,36 +307,6 @@ public class BDecoder { return null; } } - /* - public static BObject parse(InputStream is) { - if (is.available() < 1) return null; - char ch = (char) is.read(); - if ((ch >= '0') && (ch <= '9')) { - StringBuilder s = new StringBuilder(); - s.append(ch); - while ((ch = (char) is.read()) != ':') s.append(ch); - int len = Integer.parseInt(s.toString()); - byte[] b = new byte[len]; - is.read(b); - return new BStringObject(new String(b)); - } else if (ch == 'l') { - pos++; - return new BListObject(readList()); - } else if (ch == 'd') { - pos++; - return new BDictionaryObject(convertToMap(readList())); - } else if (ch == 'i') { - pos++; - int end = pos; - while (b[end] != 'e') ++end; - BIntegerObject io = new BIntegerObject(Long.parseLong(new String(b, pos, end - pos))); - pos = end + 1; - return io; - } else { - return null; - } - } - */ public static void print(BObject bo, int t) { for (int i = 0; i < t; i++) System.out.print(" ");