From c1418c62038ff64858bc210c84e5bda7e53bf4d2 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Fri, 1 Dec 2017 15:12:51 +0100 Subject: [PATCH] fix java9 compilation --- .../indices/recovery/RecoverySourceHandlerTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java b/core/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java index c04d69bbed20e..cf5f24d2a6e18 100644 --- a/core/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java +++ b/core/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java @@ -211,8 +211,10 @@ public Translog.Operation next() throws IOException { assertThat(result.totalOperations, equalTo(expectedOps)); final ArgumentCaptor shippedOpsCaptor = ArgumentCaptor.forClass(List.class); verify(recoveryTarget).indexTranslogOperations(shippedOpsCaptor.capture(), ArgumentCaptor.forClass(Integer.class).capture()); - List shippedOps = shippedOpsCaptor.getAllValues().stream() - .flatMap(List::stream).map(o -> (Translog.Operation) o).collect(Collectors.toList()); + List shippedOps = new ArrayList<>(); + for (List list: shippedOpsCaptor.getAllValues()) { + shippedOps.addAll(list); + } shippedOps.sort(Comparator.comparing(Translog.Operation::seqNo)); assertThat(shippedOps.size(), equalTo(expectedOps)); for (int i = 0; i < shippedOps.size(); i++) {