Null parameter checks in BulkProcessor.Builder#builder
This commit is contained in:
parent
dc07affff1
commit
61b7014023
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue