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
This commit is contained in:
orbiter 2005-09-15 22:17:51 +00:00
parent 51aa6d0b33
commit cddd9aaa33
2 changed files with 5 additions and 5 deletions

View File

@ -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);
}
}

View File

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