Skip to content

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

fixed double/missing null check for LURLs

orbiterc543028dd45f
diff --git a/htroot/Bookmarks.java b/htroot/Bookmarks.java
index 5e1eafab6..517ba718e 100644
--- a/htroot/Bookmarks.java
+++ b/htroot/Bookmarks.java
@@ -137,11 +137,9 @@ public class Bookmarks {
plasmaCrawlLURL.Entry urlentry = switchboard.urlPool.loadedURL.load(urlHash, null);
if (urlentry != null) {
prop.put("mode_edit", 0); // create mode
- if (urlentry != null) {
- prop.put("mode_title", urlentry.descr());
- prop.put("mode_description", urlentry.descr());
- prop.put("mode_url", urlentry.url());
- }
+ prop.put("mode_title", urlentry.descr());
+ prop.put("mode_description", urlentry.descr());
+ prop.put("mode_url", urlentry.url());
prop.put("mode_tags", "");
prop.put("mode_public", 0);
}
diff --git a/htroot/IndexControl_p.java b/htroot/IndexControl_p.java
index cb69d1146..0015412dc 100644
--- a/htroot/IndexControl_p.java
+++ b/htroot/IndexControl_p.java
@@ -215,15 +215,11 @@ public class IndexControl_p {
if (entry == null) {
prop.put("result", "No Entry for URL hash " + urlhash + "; nothing deleted.");
} else {
- if (entry != null) {
- URL url = entry.url();
- urlstring = url.toNormalform();
- prop.put("urlstring", "");
- switchboard.urlPool.loadedURL.remove(urlhash);
- prop.put("result", "Removed URL " + urlstring);
- } else {
- prop.put("result", "No Entry for URL hash " + urlhash + "; nothing deleted.");
- }
+ URL url = entry.url();
+ urlstring = url.toNormalform();
+ prop.put("urlstring", "");
+ switchboard.urlPool.loadedURL.remove(urlhash);
+ prop.put("result", "Removed URL " + urlstring);
}
}
@@ -266,7 +262,7 @@ public class IndexControl_p {
while (urlIter.hasNext()) {
iEntry = (indexEntry) urlIter.next();
lurl = switchboard.urlPool.loadedURL.load(iEntry.urlHash(), null);
- if (lurl.toString() == null) {
+ if (lurl == null) {
unknownURLEntries.add(iEntry.urlHash());
urlIter.remove();
} else {
@@ -329,14 +325,10 @@ public class IndexControl_p {
if (entry == null) {
prop.put("result", "No Entry for URL hash " + urlhash);
} else {
- if (entry != null) {
- URL url = entry.url();
- urlstring = url.toString();
- prop.put("urlstring", urlstring);
- prop.put("result", genUrlProfile(switchboard, entry, urlhash));
- } else {
- prop.put("result", "No Entry for URL hash " + urlhash);
- }
+ URL url = entry.url();
+ urlstring = url.toString();
+ prop.put("urlstring", urlstring);
+ prop.put("result", genUrlProfile(switchboard, entry, urlhash));
}
}
diff --git a/htroot/yacy/crawlOrder.java b/htroot/yacy/crawlOrder.java
index a1604c8d4..70ad7d9e3 100644
--- a/htroot/yacy/crawlOrder.java
+++ b/htroot/yacy/crawlOrder.java
@@ -253,14 +253,9 @@ public final class crawlOrder {
response = "rejected";
lurl = "";
} else {
- if (entry != null) {
- response = "double";
- switchboard.urlPool.loadedURL.notifyGCrawl(entry.hash(), iam, youare);
- lurl = crypt.simpleEncode(entry.toString());
- } else {
- response = "rejected";
- lurl = "";
- }
+ response = "double";
+ switchboard.urlPool.loadedURL.notifyGCrawl(entry.hash(), iam, youare);
+ lurl = crypt.simpleEncode(entry.toString());
}
} else {
response = "rejected";