Skip to content

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

fix for bug in seed list management (cause was bad class overloading, only visual effects!)

orbiter7860d5d632a2
diff --git a/htroot/Network.java b/htroot/Network.java
index a9a47fbff..dc9fc74e8 100644
--- a/htroot/Network.java
+++ b/htroot/Network.java
@@ -308,7 +308,7 @@ public class Network {
prop.put(STR_TABLE_LIST + conCount + "_updatedBlog", 0);
prop.put(STR_TABLE_LIST + conCount + "_isCrawling", 0);
if (conCount >= maxCount) { break; }
- if (sb.webIndex.seedDB.mySeed() != null && seed.hash.equals(sb.webIndex.seedDB.mySeed().hash)) {
+ if (sb.webIndex.seedDB != null && sb.webIndex.seedDB.mySeed() != null && seed.hash.equals(sb.webIndex.seedDB.mySeed().hash)) {
prop.put(STR_TABLE_LIST + conCount + "_dark", 2);
} else {
prop.put(STR_TABLE_LIST + conCount + "_dark", ((dark) ? 1 : 0) ); dark=!dark;
diff --git a/source/de/anomic/kelondro/kelondroBLOBHeap.java b/source/de/anomic/kelondro/kelondroBLOBHeap.java
index 9afd01236..3d7a91e02 100755
--- a/source/de/anomic/kelondro/kelondroBLOBHeap.java
+++ b/source/de/anomic/kelondro/kelondroBLOBHeap.java
@@ -184,7 +184,7 @@ public final class kelondroBLOBHeap implements kelondroBLOB {
* the number of BLOBs in the heap
* @return the number of BLOBs in the heap
*/
- public int size() {
+ public synchronized int size() {
return this.index.size();
}
@@ -193,7 +193,7 @@ public final class kelondroBLOBHeap implements kelondroBLOB {
* @param key
* @return true if the key exists, false othervise
*/
- public boolean has(final byte[] key) {
+ public synchronized boolean has(final byte[] key) {
assert index != null;
assert index.row().primaryKeyLength == key.length;
@@ -470,6 +470,7 @@ public final class kelondroBLOBHeap implements kelondroBLOB {
}
heap.remove("aaaaaaaaaaab".getBytes());
heap.remove("aaaaaaaaaaac".getBytes());
+ heap.put("aaaaaaaaaaaX".getBytes(), "WXYZ".getBytes());
heap.close();
} catch (final IOException e) {
e.printStackTrace();
diff --git a/source/de/anomic/kelondro/kelondroMap.java b/source/de/anomic/kelondro/kelondroMap.java
index 6c1900b50..24744f099 100644
--- a/source/de/anomic/kelondro/kelondroMap.java
+++ b/source/de/anomic/kelondro/kelondroMap.java
@@ -1,4 +1,4 @@
-// kelondroObjects.java
+// kelondroMap.java
// -----------------------
// (C) 29.01.2007 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
// first published 2004 as kelondroMap on http://www.anomic.de
@@ -87,9 +87,9 @@ public class kelondroMap {
return bb.toString();
}
- private static HashMap<String, String> string2map(final String s) throws IOException {
+ private static Map<String, String> string2map(final String s) throws IOException {
final BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(s.getBytes())));
- final HashMap<String, String> map = new HashMap<String, String>();
+ final Map<String, String> map = new HashMap<String, String>();
String line;
int pos;
while ((line = br.readLine()) != null) { // very slow readLine????
@@ -317,7 +317,7 @@ public class kelondroMap {
// make map
kelondroMap map = new kelondroMap(blob, 1024);
// put some values into the map
- HashMap<String, String> m = new HashMap<String, String>();
+ Map<String, String> m = new HashMap<String, String>();
m.put("k", "000"); map.put("123", m);
m.put("k", "111"); map.put("456", m);
m.put("k", "222"); map.put("789", m);
diff --git a/source/de/anomic/kelondro/kelondroMapDataMining.java b/source/de/anomic/kelondro/kelondroMapDataMining.java
index 410212baf..bb51f554d 100644
--- a/source/de/anomic/kelondro/kelondroMapDataMining.java
+++ b/source/de/anomic/kelondro/kelondroMapDataMining.java
@@ -1,4 +1,4 @@
-// kelondroMapObjects.java
+// kelondroMapDataMining.java
// -----------------------
// (C) 29.01.2007 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
// first published 2004 as part of kelondroMap on http://www.anomic.de
@@ -164,7 +164,7 @@ public class kelondroMapDataMining extends kelondroMap {
}
}
- public synchronized void put(final String key, final HashMap<String, String> newMap) throws IOException {
+ public synchronized void put(final String key, final Map<String, String> newMap) throws IOException {
assert (key != null);
assert (key.length() > 0);
assert (newMap != null);