From 61b701402390337cce2d1192a756e94d7ca89325 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 1 Jan 2016 19:52:24 -0500 Subject: [PATCH] Null parameter checks in BulkProcessor.Builder#builder --- .../java/org/elasticsearch/action/bulk/BulkProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java b/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java index c4d2cd6af2d..78a0c76702f 100644 --- a/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java +++ b/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java @@ -32,6 +32,7 @@ import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.FutureUtils; import java.io.Closeable; +import java.util.Objects; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; @@ -167,9 +168,8 @@ public class BulkProcessor implements Closeable { } public static Builder builder(Client client, Listener listener) { - if (client == null) { - throw new NullPointerException("The client you specified while building a BulkProcessor is null"); - } + Objects.requireNonNull(client, "client"); + Objects.requireNonNull(listener, "listener"); return new Builder(client, listener); }