From 2a05030e22524f81d44a78e028b05dee9f967228 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Tue, 9 Aug 2016 12:14:50 +0200 Subject: [PATCH] Fix after merge --- .../admin/cluster/node/tasks/list/ListTasksResponse.java | 4 ++-- .../cluster/node/tasks/list/TransportListTasksAction.java | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java index 9fdc7ae6a30..dff503807b7 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java @@ -19,7 +19,6 @@ package org.elasticsearch.action.admin.cluster.node.tasks.list; -import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.FailedNodeException; import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.action.support.tasks.BaseTasksResponse; @@ -30,7 +29,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskInfo; @@ -133,6 +131,7 @@ public class ListTasksResponse extends BaseTasksResponse implements ToXContent { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); if (getTaskFailures() != null && getTaskFailures().size() > 0) { builder.startArray("task_failures"); for (TaskOperationFailure ex : getTaskFailures()){ @@ -196,6 +195,7 @@ public class ListTasksResponse extends BaseTasksResponse implements ToXContent { } builder.endObject(); } + builder.endObject(); return builder; } diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java index bbc5a5a9528..a1f84f87f9d 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java @@ -35,10 +35,8 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import java.io.IOException; -import java.util.Collections; import java.util.List; import java.util.function.Consumer; -import java.util.function.Supplier; import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;