Null parameter checks in BulkProcessor.Builder#builder

This commit is contained in:
Jason Tedor 2016-01-01 19:52:24 -05:00
parent dc07affff1
commit 61b7014023
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}