Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix for null-entries and http://www.yacy-forum.de/viewtopic.php?p=8649
orbiter43b42854a0e9
diff --git a/source/de/anomic/kelondro/kelondroRecords.java b/source/de/anomic/kelondro/kelondroRecords.javaindex 79311d4b5..09adce8f8 100644--- a/source/de/anomic/kelondro/kelondroRecords.java+++ b/source/de/anomic/kelondro/kelondroRecords.java@@ -630,7 +630,7 @@ public class kelondroRecords {entryFile.seek(seek);values[i] = new byte[COLWIDTHS[i]];entryFile.read(values[i], 0, values[i].length);- if (values[i][0] == 0) values[i] = null;+ if (allZero(values[i])) values[i] = null;seek += COLWIDTHS[i];}}@@ -644,7 +644,7 @@ public class kelondroRecords {entryFile.seek(seek);values[i] = new byte[COLWIDTHS[i]];entryFile.read(values[i], 0, values[i].length);- if (values[i][0] == 0) values[i] = null;+ if (allZero(values[i])) values[i] = null;seek += COLWIDTHS[i];}}@@ -690,6 +690,10 @@ public class kelondroRecords {seek = seek + COLWIDTHS[i];}}+ private boolean allZero(byte[] a) {+ for (int i = 0; i < a.length; i++) if (a[i] != 0) return false;+ return true;+ }public String toString() {if (this.handle.index == NUL) return "NULL";String s = Integer.toHexString(this.handle.index);diff --git a/source/de/anomic/plasma/plasmaWordIndexCache.java b/source/de/anomic/plasma/plasmaWordIndexCache.javaindex 9e7092f29..ffa030197 100644--- a/source/de/anomic/plasma/plasmaWordIndexCache.java+++ b/source/de/anomic/plasma/plasmaWordIndexCache.java@@ -213,7 +213,7 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {while (i-- > 0) {// get out one entryrow = dumpArray.get(i);- if ((row[0] == null)/* || (row[1] == null) || (row[2] == null)*/ || (row[3] == null) || (row[4] == null)) continue;+ if ((row[0] == null) || (row[1] == null) || (row[2] == null) || (row[3] == null) || (row[4] == null)) continue;wordHash = new String(row[0]);creationTime = kelondroRecords.bytes2long(row[2]);wordEntry = new plasmaWordIndexEntry(new String(row[3]), new String(row[4]));diff --git a/yacy.logging b/yacy.loggingindex 8ff8b6141..376b7e929 100644--- a/yacy.logging+++ b/yacy.logging@@ -12,9 +12,9 @@# FINE in-function status debug outputPARSER.level = INFOPROXY.level = INFO-YACY.level = INFO+YACY.level = FINEHTCACHE.level = INFO-PLASMA.level = INFO+PLASMA.level = FINESERVER.level = INFOWORDMIGRATION.level = FINEFILEHANDLER.level = INFO