Skip to content

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

fixed a null pointer exception problem reported in the forum. I cant find the forum entry any more because my girlfriend switched off the power while the forum window was open.

orbiterf8efb3c94846
diff --git a/build.properties b/build.properties
index 6aa6c2d48..d9680aabc 100644
--- a/build.properties
+++ b/build.properties
@@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4
# Release Configuration
-releaseVersion=0.487
+releaseVersion=0.488
releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}
diff --git a/source/de/anomic/index/indexRWIEntryNew.java b/source/de/anomic/index/indexRWIEntryNew.java
index 8d857093d..dc2efb9b0 100644
--- a/source/de/anomic/index/indexRWIEntryNew.java
+++ b/source/de/anomic/index/indexRWIEntryNew.java
@@ -149,6 +149,7 @@ public class indexRWIEntryNew implements Cloneable, indexRWIEntry {
}
public indexRWIEntryNew(indexRWIEntryOld oldEntry) {
+ assert oldEntry.urlHash() != null;
this.entry = urlEntryRow.newEntry();
int mddlm = plasmaWordIndex.microDateDays(oldEntry.lastModified());
int mddct = plasmaWordIndex.microDateDays(System.currentTimeMillis());
diff --git a/source/de/anomic/index/indexRWIEntryOld.java b/source/de/anomic/index/indexRWIEntryOld.java
index a0010f84b..cb090d988 100644
--- a/source/de/anomic/index/indexRWIEntryOld.java
+++ b/source/de/anomic/index/indexRWIEntryOld.java
@@ -99,6 +99,7 @@ public class indexRWIEntryOld implements Cloneable, indexRWIEntry {
// more needed attributes:
// - boolean: appearance attributes: title, appears in header, anchor-descr, image-tag, hervorhebungen, meta-tags, word in link etc
// - boolean: URL attributes
+ assert (urlHash != null);
assert (urlHash.length() == 12) : "urlhash = " + urlHash;
if ((language == null) || (language.length() != urlEntryRow.width(col_language))) language = "uk";
this.entry = urlEntryRow.newEntry();
diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java
index 35d7220b6..f51036c03 100644
--- a/source/de/anomic/plasma/plasmaWordIndex.java
+++ b/source/de/anomic/plasma/plasmaWordIndex.java
@@ -239,8 +239,11 @@ public final class plasmaWordIndex implements indexRI {
}
public indexContainer addEntry(String wordHash, indexRWIEntry entry, long updateTime, boolean dhtInCase) {
- if ((useCollectionIndex) && (entry instanceof indexRWIEntryOld)) entry = new indexRWIEntryNew((indexRWIEntryOld) entry);
-
+ if ((useCollectionIndex) && (entry instanceof indexRWIEntryOld)) {
+ if (entry.urlHash() == null) return null;
+ entry = new indexRWIEntryNew((indexRWIEntryOld) entry);
+ }
+
// set dhtInCase depending on wordHash
if ((!dhtInCase) && (yacyDHTAction.shallBeOwnWord(wordHash))) dhtInCase = true;
@@ -261,7 +264,9 @@ public final class plasmaWordIndex implements indexRI {
indexRWIEntryOld old;
while (i.hasNext()) {
old = (indexRWIEntryOld) i.next();
- newentries.add(new indexRWIEntryNew(old));
+ if (old.urlHash() != null) {
+ newentries.add(new indexRWIEntryNew(old));
+ }
}
return newentries;
}
diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.java
index 69afaa936..20d0f1470 100644
--- a/source/de/anomic/yacy/yacyClient.java
+++ b/source/de/anomic/yacy/yacyClient.java
@@ -553,6 +553,7 @@ public final class yacyClient {
// add the url entry to the word indexes
for (int m = 0; m < words; m++) {
if ((wordIndex.useCollectionIndex) && (entry instanceof indexRWIEntryOld)) {
+ if (entry.urlHash() == null) continue;
entry = new indexRWIEntryNew((indexRWIEntryOld) entry);
}
container[m].add(new indexRWIEntry[]{entry}, System.currentTimeMillis());