From 777a6a5fca253a104c97f47ccdad1f231f1e951b Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Sun, 14 Oct 2018 22:21:27 +0200 Subject: Revert "Revert "Simplify and correct isFilled"" --- .../src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java | 2 +- .../main/java/com/yahoo/vespa/http/client/config/SessionParams.java | 1 + .../vespa/http/client/core/communication/ApacheGatewayConnection.java | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'vespa-http-client/src/main/java/com') diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java index 4f5b30444a9..06edd222be2 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java @@ -30,7 +30,7 @@ public final class FeedParams { * Enumeration of data formats that are acceptable by the OutputStream * returned by {@link com.yahoo.vespa.http.client.Session#stream(CharSequence)}. */ - public static enum DataFormat { + public enum DataFormat { /** UTF-8-encoded XML. Preamble is not necessary. */ XML_UTF8, JSON_UTF8 diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/SessionParams.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/SessionParams.java index 9a8640d09e2..eb3e8ec982b 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/SessionParams.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/SessionParams.java @@ -35,6 +35,7 @@ public final class SessionParams { * settings, use {@link #setConnectionParams(ConnectionParams)}. */ public static final class Builder { + private final List clusters = new LinkedList<>(); private FeedParams feedParams = new FeedParams.Builder().build(); private ConnectionParams connectionParams = new ConnectionParams.Builder().build(); diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java index c2e94e14486..e9852de215a 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java @@ -160,8 +160,8 @@ class ApacheGatewayConnection implements GatewayConnection { } private ByteBuffer[] getDataWithStartAndEndOfFeed(List docs, int version) { - List data = new ArrayList(); - if (version == 2 || version == 3) { + List data = new ArrayList<>(); + if (version == 2 || version == 3) { // TODO: Vespa 7: Remove support for version 2 for (Document doc : docs) { int operationSize = doc.size() + startOfFeed.length + endOfFeed.length; StringBuilder envelope = new StringBuilder(); -- cgit v1.2.3