Fix eclipse compile issues (#29056)

Eclipse Oxygen doesn't seem to be able to infer the correct type
arguments for Arrays::asList in the given test context. Adding cast to
make this more explicit.
This commit is contained in:
Christoph Büscher 2018-03-14 13:44:12 +01:00 committed by GitHub
parent d3d7c04524
commit 90469123b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ public class IOUtilsTests extends ESTestCase {
}
public void testCloseIterable() throws IOException {
runTestClose(Arrays::asList, IOUtils::close);
runTestClose((Function<Closeable[], List<Closeable>>) Arrays::asList, IOUtils::close);
}
private <T> void runTestClose(final Function<Closeable[], T> function, final CheckedConsumer<T, IOException> close) throws IOException {
@ -74,7 +74,7 @@ public class IOUtilsTests extends ESTestCase {
}
public void testCloseIterableWithIOExceptions() throws IOException {
runTestCloseWithIOExceptions(Arrays::asList, IOUtils::close);
runTestCloseWithIOExceptions((Function<Closeable[], List<Closeable>>) Arrays::asList, IOUtils::close);
}
private <T> void runTestCloseWithIOExceptions(
@ -113,7 +113,7 @@ public class IOUtilsTests extends ESTestCase {
}
public void testDeleteFilesIgnoringExceptionsIterable() throws IOException {
runDeleteFilesIgnoringExceptionsTest(Arrays::asList, IOUtils::deleteFilesIgnoringExceptions);
runDeleteFilesIgnoringExceptionsTest((Function<Path[], List<Path>>) Arrays::asList, IOUtils::deleteFilesIgnoringExceptions);
}
private <T> void runDeleteFilesIgnoringExceptionsTest(