From 4ee4ba15764bcc12dc0601215b7d4a460413bf13 Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 22 Apr 2014 19:48:49 +0200 Subject: [PATCH] fix for NPE in IndexCreateParserErrors_p.html caused by bad handling of lazy value instantiation of 0-value in crawldepth_i --- htroot/HostBrowser.java | 2 +- source/net/yacy/search/schema/CollectionConfiguration.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java index 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 list diff --git a/source/net/yacy/search/schema/CollectionConfiguration.java b/source/net/yacy/search/schema/CollectionConfiguration.java index 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 Seri this.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;