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:
parent
2fb4a0d40c
commit
d1be2ecfdb
|
@ -44,9 +44,6 @@ public class BaseTasksResponse extends ActionResponse {
|
||||||
private List<TaskOperationFailure> taskFailures;
|
private List<TaskOperationFailure> taskFailures;
|
||||||
private List<FailedNodeException> nodeFailures;
|
private List<FailedNodeException> nodeFailures;
|
||||||
|
|
||||||
public BaseTasksResponse() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseTasksResponse(List<TaskOperationFailure> taskFailures, List<? extends FailedNodeException> nodeFailures) {
|
public BaseTasksResponse(List<TaskOperationFailure> taskFailures, List<? extends FailedNodeException> nodeFailures) {
|
||||||
this.taskFailures = taskFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(taskFailures));
|
this.taskFailures = taskFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(taskFailures));
|
||||||
this.nodeFailures = nodeFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(nodeFailures));
|
this.nodeFailures = nodeFailures == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(nodeFailures));
|
||||||
|
|
|
@ -386,7 +386,7 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin {
|
||||||
private List<UnblockTestTaskResponse> tasks;
|
private List<UnblockTestTaskResponse> tasks;
|
||||||
|
|
||||||
public UnblockTestTasksResponse() {
|
public UnblockTestTasksResponse() {
|
||||||
|
super(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UnblockTestTasksResponse(List<UnblockTestTaskResponse> tasks, List<TaskOperationFailure> taskFailures, List<? extends
|
public UnblockTestTasksResponse(List<UnblockTestTaskResponse> tasks, List<TaskOperationFailure> taskFailures, List<? extends
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
|
||||||
private List<TestTaskResponse> tasks;
|
private List<TestTaskResponse> tasks;
|
||||||
|
|
||||||
TestTasksResponse() {
|
TestTasksResponse() {
|
||||||
|
super(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
TestTasksResponse(List<TestTaskResponse> tasks, List<TaskOperationFailure> taskFailures,
|
TestTasksResponse(List<TestTaskResponse> tasks, List<TaskOperationFailure> taskFailures,
|
||||||
|
|
Loading…
Reference in New Issue