From 1ad5398af7033a44726ba986f9d1c7ba74ba9f7f Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 6 Apr 2017 20:40:55 -0400 Subject: [PATCH] Fix compilation in Eclipse (#23954) Eclipse seems to have trouble with CrudIT. It throws an NPE back to the user. I've filed a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=514884 but for now we should work around it. --- .../src/test/java/org/elasticsearch/client/CrudIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java index 5f738ce1eee..9e4b7569c16 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java @@ -616,7 +616,9 @@ public class CrudIT extends ESRestHighLevelClientTestCase { }; ThreadPool threadPool = new ThreadPool(Settings.builder().put("node.name", getClass().getName()).build()); - try(BulkProcessor processor = new BulkProcessor.Builder(highLevelClient()::bulkAsync, listener, threadPool) + // Pull the client to a variable to work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=514884 + RestHighLevelClient hlClient = highLevelClient(); + try(BulkProcessor processor = new BulkProcessor.Builder(hlClient::bulkAsync, listener, threadPool) .setConcurrentRequests(0) .setBulkSize(new ByteSizeValue(5, ByteSizeUnit.GB)) .setBulkActions(nbItems + 1)