From cddd9aaa336d3282a1d9ad40eb28ac017c86823d Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 15 Sep 2005 22:17:51 +0000 Subject: [PATCH] fixed SERIOUS bug with kelondroStack; affected all stack processing since 729 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@732 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/kelondroStack.java | 8 ++++---- source/de/anomic/plasma/plasmaSwitchboardQueue.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroStack.java b/source/de/anomic/kelondro/kelondroStack.java index d7b85e58f..ed48700b8 100644 --- a/source/de/anomic/kelondro/kelondroStack.java +++ b/source/de/anomic/kelondro/kelondroStack.java @@ -82,6 +82,7 @@ public class kelondroStack extends kelondroRecords { public kelondroStack(File file, long buffersize) throws IOException{ // this opens a file with an existing tree super(file, buffersize); + if ((getHandle(root) == null) && (getHandle(toor) == null)) clear(); } public void clear() throws IOException { @@ -133,10 +134,9 @@ public class kelondroStack extends kelondroRecords { n.setValues(row); n.setOHHandle(left, getHandle(toor)); n.setOHHandle(right, null); - n.commit(CP_NONE); Node n1 = getNode(getHandle(toor), null, 0); - n1.setOHHandle(left, n1.getOHHandle(left)); n1.setOHHandle(right, n.handle()); + n.commit(CP_NONE); n1.commit(CP_NONE); // assign handles setHandle(toor, n.handle()); @@ -236,8 +236,8 @@ public class kelondroStack extends kelondroRecords { } else { // un-link the following record Node k = getNode(r, null, 0); - k.setOHHandle(left, k.getOHHandle(right)); - k.setOHHandle(right, null); + k.setOHHandle(left, l); + k.setOHHandle(right, k.getOHHandle(right)); k.commit(CP_NONE); } } diff --git a/source/de/anomic/plasma/plasmaSwitchboardQueue.java b/source/de/anomic/plasma/plasmaSwitchboardQueue.java index 7b2daaf9d..bf834bc77 100644 --- a/source/de/anomic/plasma/plasmaSwitchboardQueue.java +++ b/source/de/anomic/plasma/plasmaSwitchboardQueue.java @@ -185,7 +185,7 @@ public class plasmaSwitchboardQueue { } public Entry(byte[][] row) { - long ims = serverCodings.enhancedCoder.decodeBase64Long(new String(row[2])); + long ims = (row[2] == null) ? 0 : serverCodings.enhancedCoder.decodeBase64Long(new String(row[2])); byte flags = (row[3] == null) ? 0 : row[3][0]; try { this.url = new URL(new String(row[0]));