From 43b42854a0e9341ff5724882d2172f82aa0d2190 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sun, 11 Sep 2005 03:54:52 +0000 Subject: [PATCH] fix for null-entries and http://www.yacy-forum.de/viewtopic.php?p=8649 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@699 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/kelondroRecords.java | 8 ++++++-- source/de/anomic/plasma/plasmaWordIndexCache.java | 2 +- yacy.logging | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroRecords.java b/source/de/anomic/kelondro/kelondroRecords.java index 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.java index 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 entry row = 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.logging index 8ff8b6141..376b7e929 100644 --- a/yacy.logging +++ b/yacy.logging @@ -12,9 +12,9 @@ # FINE in-function status debug output PARSER.level = INFO PROXY.level = INFO -YACY.level = INFO +YACY.level = FINE HTCACHE.level = INFO -PLASMA.level = INFO +PLASMA.level = FINE SERVER.level = INFO WORDMIGRATION.level = FINE FILEHANDLER.level = INFO