diff --git a/plugin/src/main/java/org/elasticsearch/xpack/common/GroupedActionListener.java b/plugin/src/main/java/org/elasticsearch/xpack/common/GroupedActionListener.java index d94b26b7da7..66411c6f52e 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/common/GroupedActionListener.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/common/GroupedActionListener.java @@ -49,8 +49,7 @@ public final class GroupedActionListener implements ActionListener { if (failure.get() != null) { delegate.onFailure(failure.get()); } else { - List collect = this.roles.asList().stream().map((e) - -> e.value).filter(Objects::nonNull).collect(Collectors.toList()); + List collect = this.roles.asList(); collect.addAll(defaults); delegate.onResponse(Collections.unmodifiableList(collect)); } diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/GetJobsStatsAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/GetJobsStatsAction.java index 9b279ec2215..24f06cb1265 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/GetJobsStatsAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/GetJobsStatsAction.java @@ -452,9 +452,7 @@ public class GetJobsStatsAction extends Action results = response.getResponse().results(); - results.addAll(jobStats.asList().stream() - .map(e -> e.value) - .collect(Collectors.toList())); + results.addAll(jobStats.asList()); listener.onResponse(new Response(response.getTaskFailures(), response.getNodeFailures(), new QueryPage<>(results, results.size(), Job.RESULTS_FIELD))); }