summaryrefslogtreecommitdiffstats
path: root/vespa-http-client
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-10-12 13:02:21 +0200
committerJon Bratseth <bratseth@oath.com>2018-10-12 13:02:21 +0200
commitf50c15ae1e6fbba607977e938c0967394c3abca7 (patch)
treeacf3dca3687a0d676563992e1be7ea0dfccdf24a /vespa-http-client
parent8b75677b527deffe2b4852418ab498c2bc3e3d95 (diff)
Simplify and correct isFilled
Diffstat (limited to 'vespa-http-client')
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/SessionParams.java1
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java4
3 files changed, 4 insertions, 3 deletions
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<Cluster> 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<Document> docs, int version) {
- List<ByteBuffer> data = new ArrayList<ByteBuffer>();
- if (version == 2 || version == 3) {
+ List<ByteBuffer> 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();