Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- fix for bug in svn 6669 - cleanup

orbiter2bc36de3364b
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<String, String> entry = new ConcurrentHashMap<String, String>();
try {
- entry.putAll(database.get(hash));
+ Map<String, String> 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<byte[], byte[]> 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<byte[], byte[]> next() {
final Map.Entry<byte[], byte[]> 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<String, String> 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(" ");