diff --git a/source/net/yacy/cora/federate/solr/responsewriter/FlatJSONResponseWriter.java b/source/net/yacy/cora/federate/solr/responsewriter/FlatJSONResponseWriter.java index 910f4ba1f..7042353db 100644 --- a/source/net/yacy/cora/federate/solr/responsewriter/FlatJSONResponseWriter.java +++ b/source/net/yacy/cora/federate/solr/responsewriter/FlatJSONResponseWriter.java @@ -81,11 +81,11 @@ public class FlatJSONResponseWriter implements QueryResponseWriter, EmbeddedSolr for (int i = 0; i < sz; i++) { int id = iterator.nextDoc(); Document doc = searcher.doc(id); - writeDoc(writer, schema, null, doc.getFields(), (includeScore ? iterator.score() : 0.0f), includeScore); + writeDoc(writer, schema, doc.getFields()); } } - private static final void writeDoc(final Writer writer, final IndexSchema schema, final String name, final List fields, final float score, final boolean includeScore) throws IOException { + private static final void writeDoc(final Writer writer, final IndexSchema schema, final List fields) throws IOException { JSONObject json = new JSONObject(); int sz = fields.size(); @@ -110,7 +110,7 @@ public class FlatJSONResponseWriter implements QueryResponseWriter, EmbeddedSolr JSONObject j = new JSONObject(); String sv = value.stringValue(); setValue(j, type.getTypeName(), "x", sv); //sf.write(this, null, f1); - a.put(j.get("x")); + a.put(j.opt("x")); } else { setValue(json, type.getTypeName(), value.name(), value.stringValue()); } @@ -121,7 +121,7 @@ public class FlatJSONResponseWriter implements QueryResponseWriter, EmbeddedSolr String sv = fields.get(i).stringValue(); JSONObject j = new JSONObject(); setValue(j, type.getTypeName(), "x", sv); //sf.write(this, null, f1); - a.put(j.get("x")); + a.put(j.opt("x")); } } fidx1 = fidx2; diff --git a/source/net/yacy/cora/protocol/RequestHeader.java b/source/net/yacy/cora/protocol/RequestHeader.java index 5a5160fcd..df1a09a1a 100644 --- a/source/net/yacy/cora/protocol/RequestHeader.java +++ b/source/net/yacy/cora/protocol/RequestHeader.java @@ -611,6 +611,7 @@ public class RequestHeader extends HeaderFramework implements HttpServletRequest } @Override + @SuppressWarnings("deprecation") public String getScheme() { // here we can directly check original request first, as scheme is not expected to be changed if (_request != null) { diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index b1f47fe0b..6d823344b 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -2196,7 +2196,8 @@ public final class Switchboard extends serverSwitch { if ((json.opt("index") != null && json.length() == 1) || json.length() == 0) continue; SolrInputDocument surrogate = new SolrInputDocument(); for (String key: json.keySet()) { - Object o = json.get(key); + Object o = json.opt(key); + if (o == null) continue; if (o instanceof JSONArray) { // transform this into a list JSONArray a = (JSONArray) o; @@ -3915,10 +3916,6 @@ public final class Switchboard extends serverSwitch { } } - public void initBookmarks(@SuppressWarnings("unused") boolean b) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - public class receiptSending implements Runnable { private final Seed initiatorPeer; diff --git a/test/java/net/yacy/http/servlets/YaCyDefaultServletTest.java b/test/java/net/yacy/http/servlets/YaCyDefaultServletTest.java index 1c8527425..1171c658c 100644 --- a/test/java/net/yacy/http/servlets/YaCyDefaultServletTest.java +++ b/test/java/net/yacy/http/servlets/YaCyDefaultServletTest.java @@ -67,6 +67,7 @@ public class YaCyDefaultServletTest { * custom "CONNECTION_PROP_PROTOCOL" header indicates the protocol */ @Test + @SuppressWarnings("deprecation") public void testGetContextCustomProtocolHeader() { RequestHeader header = new RequestHeader(); header.put(HeaderFramework.HOST, "myhost.com:8443"); @@ -84,6 +85,7 @@ public class YaCyDefaultServletTest { * custom "CONNECTION_PROP_PROTOCOL" indicates the protocol */ @Test + @SuppressWarnings("deprecation") public void testGetContextDefaultPortCustomProtocolHeader() { RequestHeader header = new RequestHeader(); header.put(HeaderFramework.HOST, "myhost.com"); @@ -99,7 +101,8 @@ public class YaCyDefaultServletTest { /** * getContext() : reverse proxy serving HTTPS, YaCy serving HTTP */ - @Test + @Test + @SuppressWarnings("deprecation") public void testGetContextReverseProxy() { /* Different protocols : HTTPS on proxy, HTTP on peer */ RequestHeader header = new RequestHeader();