From d1be2ecfdb0910f1c365ec3d51958a4434b33eb9 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Mon, 19 Jun 2017 16:37:21 +0100 Subject: [PATCH] Initialise empty lists in BaseTaskResponse constructor (#25290) * Initialise empty lists in BaseTaskResponse constructor * Remove little used default constructor which leaves uninitialised members --- .../elasticsearch/action/support/tasks/BaseTasksResponse.java | 3 --- .../action/admin/cluster/node/tasks/TestTaskPlugin.java | 2 +- .../admin/cluster/node/tasks/TransportTasksActionTests.java | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java b/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java index 4ddbe541993..fdbd8e6fe70 100644 --- a/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java +++ b/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java @@ -44,9 +44,6 @@ public class BaseTasksResponse extends ActionResponse { private List taskFailures; private List nodeFailures; - public BaseTasksResponse() { - } - public BaseTasksResponse(List taskFailures, List nodeFailures) { this.taskFailures = taskFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(taskFailures)); this.nodeFailures = nodeFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(nodeFailures)); diff --git a/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java b/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java index ec981442b57..f113f49a415 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java +++ b/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java @@ -386,7 +386,7 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin { private List tasks; public UnblockTestTasksResponse() { - + super(null, null); } public UnblockTestTasksResponse(List tasks, List taskFailures, List tasks; TestTasksResponse() { - + super(null, null); } TestTasksResponse(List tasks, List taskFailures,