Skip to content

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

tried to fix seed2.old.db-problem

orbiter19286fa2d18d
diff --git a/source/de/anomic/kelondro/kelondroDyn.java b/source/de/anomic/kelondro/kelondroDyn.java
index fd863ef0b..ca91a55d5 100644
--- a/source/de/anomic/kelondro/kelondroDyn.java
+++ b/source/de/anomic/kelondro/kelondroDyn.java
@@ -114,15 +114,12 @@ public class kelondroDyn {
buffer = new kelondroObjectBuffer(file.toString());
}
- public static final void delete(File file, boolean usetree) {
- if (usetree) {
+ public static final void delete(File file) {
+ if (file.isFile()) {
file.delete();
+ if (file.exists()) file.deleteOnExit();
} else {
- if (file.isDirectory()) {
- kelondroFlexWidthArray.delete(file.getParentFile(), file.getName());
- } else {
- file.delete();
- }
+ kelondroFlexWidthArray.delete(file.getParentFile(), file.getName());
}
}
@@ -199,7 +196,7 @@ public class kelondroDyn {
kelondroRow.Entry nt;
while (ri.hasNext()) {
nt = (kelondroRow.Entry) ri.next();
- if (nt == null) throw new kelondroException("no more elements available");
+ if (nt == null) return null;
g = nt.getColBytes(0);
if (g == null) return null;
k = new String(g, 0, keylen);
diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java
index f3ba0e0f6..ba6c0805b 100644
--- a/source/de/anomic/yacy/yacySeedDB.java
+++ b/source/de/anomic/yacy/yacySeedDB.java
@@ -224,7 +224,7 @@ public final class yacySeedDB {
return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
} catch (Exception e) {
// try again
- kelondroDyn.delete(seedDBFile, usetree);
+ kelondroDyn.delete(seedDBFile);
return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
}
}