Initialise empty lists in BaseTaskResponse constructor (#25290)

* Initialise empty lists in BaseTaskResponse constructor

* Remove little used default constructor which leaves uninitialised members
This commit is contained in:
David Kyle 2017-06-19 16:37:21 +01:00 committed by GitHub
parent 2fb4a0d40c
commit d1be2ecfdb
3 changed files with 2 additions and 5 deletions

View File

@ -44,9 +44,6 @@ public class BaseTasksResponse extends ActionResponse {
private List<TaskOperationFailure> taskFailures;
private List<FailedNodeException> nodeFailures;
public BaseTasksResponse() {
}
public BaseTasksResponse(List<TaskOperationFailure> taskFailures, List<? extends FailedNodeException> nodeFailures) {
this.taskFailures = taskFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(taskFailures));
this.nodeFailures = nodeFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(nodeFailures));

View File

@ -386,7 +386,7 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin {
private List<UnblockTestTaskResponse> tasks;
public UnblockTestTasksResponse() {
super(null, null);
}
public UnblockTestTasksResponse(List<UnblockTestTaskResponse> tasks, List<TaskOperationFailure> taskFailures, List<? extends

View File

@ -217,7 +217,7 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
private List<TestTaskResponse> tasks;
TestTasksResponse() {
super(null, null);
}
TestTasksResponse(List<TestTaskResponse> tasks, List<TaskOperationFailure> taskFailures,