Skip to content

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

fixed SERIOUS bug with kelondroStack; affected all stack processing since 729

orbitercddd9aaa336d
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]));