Skip to content

Commit

Permalink
fix for NPE in IndexControlRWIs_p.java
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4221 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Nov 16, 2007
1 parent c527969 commit bf9a9e4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
1 change: 0 additions & 1 deletion htroot/IndexControlRWIs_p.html
Expand Up @@ -159,7 +159,6 @@ <h2>Index Administration</h2>
<td>remote links</td>
<td>hitcount</td>
<td>props</td>
<td></td>
</tr>
#{urlList}#
<tr class="TableCellLight">
Expand Down
41 changes: 18 additions & 23 deletions htroot/IndexControlRWIs_p.java
Expand Up @@ -29,7 +29,6 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
Expand Down Expand Up @@ -405,7 +404,10 @@ private static void genURLList(serverObjects prop, String keyhash, String keystr
long rn = -1;
while (iter.hasNext()) {
entry = (indexURLEntry) iter.next();
us = entry.comp().url().toNormalform(false, false);
if ((entry == null) || (entry.comp() == null)) continue;
url = entry.comp().url();
if (url == null) continue;
us = url.toNormalform(false, false);
if (rn == -1) rn = entry.ranking();
prop.put("genUrlList_urlList_"+i+"_urlExists", "1");
prop.put("genUrlList_urlList_"+i+"_urlExists_urlhxCount", i);
Expand All @@ -415,21 +417,21 @@ private static void genURLList(serverObjects prop, String keyhash, String keystr
prop.putHTML("genUrlList_urlList_"+i+"_urlExists_urlString", us);
prop.put("genUrlList_urlList_"+i+"_urlExists_urlStringShort", (us.length() > 40) ? (us.substring(0, 20) + "<br>" + us.substring(20, 40) + "...") : ((us.length() > 30) ? (us.substring(0, 20) + "<br>" + us.substring(20)) : us));
prop.putNum("genUrlList_urlList_"+i+"_urlExists_ranking", (entry.ranking() - rn));
prop.put("genUrlList_urlList_"+i+"_urlExists_domlength", yacyURL.domLengthEstimation(entry.hash()));
prop.put("genUrlList_urlList_"+i+"_urlExists_ybr", plasmaSearchRankingProcess.ybr(entry.hash()));
prop.putNum("genUrlList_urlList_"+i+"_urlExists_domlength", yacyURL.domLengthEstimation(entry.hash()));
prop.putNum("genUrlList_urlList_"+i+"_urlExists_ybr", plasmaSearchRankingProcess.ybr(entry.hash()));
prop.put("genUrlList_urlList_"+i+"_urlExists_date", serverDate.shortDayTime(new Date(entry.word().lastModified())));
prop.put("genUrlList_urlList_"+i+"_urlExists_wordsintitle", entry.word().wordsintitle());
prop.put("genUrlList_urlList_"+i+"_urlExists_wordsintext", entry.word().wordsintext());
prop.put("genUrlList_urlList_"+i+"_urlExists_phrasesintext", entry.word().phrasesintext());
prop.put("genUrlList_urlList_"+i+"_urlExists_llocal", entry.word().llocal());
prop.put("genUrlList_urlList_"+i+"_urlExists_lother", entry.word().lother());
prop.put("genUrlList_urlList_"+i+"_urlExists_hitcount", entry.word().hitcount());
prop.put("genUrlList_urlList_"+i+"_urlExists_worddistance", entry.word().worddistance());
prop.put("genUrlList_urlList_"+i+"_urlExists_pos", entry.word().posintext());
prop.put("genUrlList_urlList_"+i+"_urlExists_phrase", entry.word().posofphrase());
prop.put("genUrlList_urlList_"+i+"_urlExists_posinphrase", entry.word().posinphrase());
prop.put("genUrlList_urlList_"+i+"_urlExists_urlcomps", entry.word().urlcomps());
prop.put("genUrlList_urlList_"+i+"_urlExists_urllength", entry.word().urllength());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_wordsintitle", entry.word().wordsintitle());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_wordsintext", entry.word().wordsintext());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_phrasesintext", entry.word().phrasesintext());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_llocal", entry.word().llocal());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_lother", entry.word().lother());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_hitcount", entry.word().hitcount());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_worddistance", entry.word().worddistance());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_pos", entry.word().posintext());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_phrase", entry.word().posofphrase());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_posinphrase", entry.word().posinphrase());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_urlcomps", entry.word().urlcomps());
prop.putNum("genUrlList_urlList_"+i+"_urlExists_urllength", entry.word().urllength());
prop.put("genUrlList_urlList_"+i+"_urlExists_props",
((entry.word().flags().get(plasmaCondenser.flag_cat_indexof)) ? "appears on index page, " : "") +
((entry.word().flags().get(plasmaCondenser.flag_cat_hasimage)) ? "contains images, " : "") +
Expand All @@ -444,13 +446,6 @@ private static void genURLList(serverObjects prop, String keyhash, String keystr
((entry.word().flags().get(indexRWIEntry.flag_app_emphasized)) ? "appears emphasized, " : "") +
((yacyURL.probablyRootURL(entry.word().urlHash())) ? "probably root url" : "")
);
prop.put("genUrlList_urlList_"+i+"_urlExists_phrase", entry.word().posofphrase());
prop.put("genUrlList_urlList_"+i+"_urlExists_phrase", entry.word().posofphrase());
try {
url = new yacyURL(us, null);
} catch (MalformedURLException e) {
url = null;
}
if (plasmaSwitchboard.urlBlacklist.isListed(plasmaURLPattern.BLACKLIST_DHT, url)) {
prop.put("genUrlList_urlList_"+i+"_urlExists_urlhxChecked", "1");
}
Expand Down

0 comments on commit bf9a9e4

Please sign in to comment.