fixed double/missing null check for LURLs

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2520 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2006-09-08 11:54:28 +00:00
parent 406e170e25
commit c543028dd4
3 changed files with 16 additions and 31 deletions

View File

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

View File

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

View File

@ -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";