From cd197bb555af41f6dba39c6a19e748ff00d81778 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sun, 10 Mar 2013 19:46:06 +0100 Subject: [PATCH 1/2] fix for NPE if surrogates do not exist --- source/net/yacy/search/Switchboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index 0eff8cc9c..16ca11ada 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -1973,7 +1973,7 @@ public final class Switchboard extends serverSwitch { try { // check surrogates final String[] surrogatelist = this.surrogatesInPath.list(); - if ( surrogatelist.length > 0 ) { + if ( surrogatelist != null && surrogatelist.length > 0 ) { // look if the is any xml inside for ( final String surrogate : surrogatelist ) { From 4490133909587ee247de019202330b8ae25c20e3 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Mon, 11 Mar 2013 10:46:29 +0100 Subject: [PATCH 2/2] removed target_tag_s (superfluous) --- source/net/yacy/search/schema/CollectionConfiguration.java | 4 ++-- source/net/yacy/search/schema/WebgraphConfiguration.java | 1 - source/net/yacy/search/schema/WebgraphSchema.java | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/net/yacy/search/schema/CollectionConfiguration.java b/source/net/yacy/search/schema/CollectionConfiguration.java index bbcc582a7..76fca2290 100644 --- a/source/net/yacy/search/schema/CollectionConfiguration.java +++ b/source/net/yacy/search/schema/CollectionConfiguration.java @@ -710,10 +710,10 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri // list all links WebgraphConfiguration.Subgraph subgraph = webgraph.edges(digestURI, responseHeader, profile.collections(), clickdepth, document.getAnchors(), images, inboundLinks, outboundLinks); doc.webgraphDocuments.addAll(subgraph.edges); - if (allAttr || contains(CollectionSchema.inboundlinks_tag_txt)) add(doc, CollectionSchema.inboundlinks_tag_txt, subgraph.tags[0]); + if (allAttr || contains(CollectionSchema.inboundlinks_tag_txt)) add(doc, CollectionSchema.inboundlinks_tag_txt, subgraph.tags[0]); // if inboundlinks_tag_txt can be removed, remove also subgraph.tags if (allAttr || contains(CollectionSchema.inboundlinks_protocol_sxt)) add(doc, CollectionSchema.inboundlinks_protocol_sxt, protocolList2indexedList(subgraph.urlProtocols[0])); if (allAttr || contains(CollectionSchema.inboundlinks_urlstub_txt)) add(doc, CollectionSchema.inboundlinks_urlstub_txt, subgraph.urlStubs[0]); - if (allAttr || contains(CollectionSchema.outboundlinks_tag_txt)) add(doc, CollectionSchema.outboundlinks_tag_txt, subgraph.tags[1]); + if (allAttr || contains(CollectionSchema.outboundlinks_tag_txt)) add(doc, CollectionSchema.outboundlinks_tag_txt, subgraph.tags[1]); // if outboundlinks_tag_txt can be removed, remove also subgraph.tags if (allAttr || contains(CollectionSchema.outboundlinks_protocol_sxt)) add(doc, CollectionSchema.outboundlinks_protocol_sxt, protocolList2indexedList(subgraph.urlProtocols[1])); if (allAttr || contains(CollectionSchema.outboundlinks_urlstub_txt)) add(doc, CollectionSchema.outboundlinks_urlstub_txt, subgraph.urlStubs[1]); diff --git a/source/net/yacy/search/schema/WebgraphConfiguration.java b/source/net/yacy/search/schema/WebgraphConfiguration.java index 2477ec2bd..68420e970 100644 --- a/source/net/yacy/search/schema/WebgraphConfiguration.java +++ b/source/net/yacy/search/schema/WebgraphConfiguration.java @@ -195,7 +195,6 @@ public class WebgraphConfiguration extends SchemaConfiguration implements Serial if (allAttr || contains(WebgraphSchema.target_linktext_wordcount_i)) add(edge, WebgraphSchema.target_linktext_wordcount_i, text.length() > 0 ? CommonPattern.SPACE.split(text).length : 0); String tag = " 0 ? " rel=\"" + rel + "\"" : "") + (name.length() > 0 ? " name=\"" + name + "\"" : "") + ">" + ((text.length() > 0) ? text : "") + ""; subgraph.tags[ioidx].add(tag); - if (allAttr || contains(WebgraphSchema.target_tag_s)) add(edge, WebgraphSchema.target_tag_s, tag); ImageEntry ientry = images.get(target_url); String alttext = ientry == null ? "" : ientry.alt(); if (allAttr || contains(WebgraphSchema.target_alt_t)) add(edge, WebgraphSchema.target_alt_t, alttext); diff --git a/source/net/yacy/search/schema/WebgraphSchema.java b/source/net/yacy/search/schema/WebgraphSchema.java index 4202f2e08..b395e30ca 100644 --- a/source/net/yacy/search/schema/WebgraphSchema.java +++ b/source/net/yacy/search/schema/WebgraphSchema.java @@ -73,7 +73,6 @@ public enum WebgraphSchema implements SchemaDeclaration { target_protocol_s(SolrType.string, true, true, false, "the protocol of the url (target)"), target_urlstub_s(SolrType.string, true, true, false, "the url without the protocol (target)"), target_file_ext_s(SolrType.string, true, true, false, "the file name extension (target)"), - target_tag_s(SolrType.string, true, true, false, "normalized (absolute URLs), as - tag with anchor text and nofollow (target)"), target_chars_i(SolrType.num_integer, true, true, false, "number of all characters in the url (target)"), target_path_s(SolrType.string, true, true, false, "path of the url (target)"), target_path_folders_count_i(SolrType.num_integer, true, true, false, "count of all path elements in the url (target)"),