Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix for NPE in IndexCreateParserErrors_p.html caused by bad handling of lazy value instantiation of 0-value in crawldepth_i
orbiter4ee4ba15764b
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.javaindex 95ed59cff..649ac7ba4 100644--- a/htroot/HostBrowser.java+++ b/htroot/HostBrowser.java@@ -573,7 +573,7 @@ public class HostBrowser {Integer rc_internal = (Integer) doc.getFieldValue(CollectionSchema.references_internal_i.getSolrFieldName());Integer rc_external = (Integer) doc.getFieldValue(CollectionSchema.references_external_i.getSolrFieldName());Integer rc_exthosts = (Integer) doc.getFieldValue(CollectionSchema.references_exthosts_i.getSolrFieldName());- this.crawldepth = (cr == null || cr.intValue() < 0) ? 998 : cr.intValue();+ this.crawldepth = (cr == null || cr.intValue() < 0) ? 0 : cr.intValue(); // for lazy value storage; non-existent means: stored as '0'this.references = (rc == null || rc.intValue() <= 0) ? 0 : rc.intValue();this.references_internal = (rc_internal == null || rc_internal.intValue() <= 0) ? 0 : rc_internal.intValue();// calculate the url reference listdiff --git a/source/net/yacy/search/schema/CollectionConfiguration.java b/source/net/yacy/search/schema/CollectionConfiguration.javaindex 09166bf1c..673f55ec1 100644--- a/source/net/yacy/search/schema/CollectionConfiguration.java+++ b/source/net/yacy/search/schema/CollectionConfiguration.java@@ -1502,7 +1502,8 @@ public class CollectionConfiguration extends SchemaConfiguration implements Serithis.failType = fts == null ? FailType.fail : FailType.valueOf(fts);this.httpstatus = (Integer) doc.getFieldValue(CollectionSchema.httpstatus_i.getSolrFieldName());this.failtime = (Date) doc.getFieldValue(CollectionSchema.load_date_dt.getSolrFieldName());- this.crawldepth = (Integer) doc.getFieldValue(CollectionSchema.crawldepth_i.getSolrFieldName());+ Integer cd = (Integer) doc.getFieldValue(CollectionSchema.crawldepth_i.getSolrFieldName());+ this.crawldepth = cd == null ? 0 : cd.intValue();}public DigestURL getDigestURL() {return digestURL;