Skip to content

Commit 7e67a4f

Browse files
committed
Remove notNull checks for API items that aren't marked nullable
1 parent d90a54a commit 7e67a4f

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

driver-core/src/main/com/mongodb/internal/operation/AsyncCommandBatchCursor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747

4848
import static com.mongodb.assertions.Assertions.assertNotNull;
4949
import static com.mongodb.assertions.Assertions.assertTrue;
50-
import static com.mongodb.assertions.Assertions.notNull;
5150
import static com.mongodb.internal.operation.CommandBatchCursorHelper.FIRST_BATCH;
5251
import static com.mongodb.internal.operation.CommandBatchCursorHelper.MESSAGE_IF_CLOSED_AS_CURSOR;
5352
import static com.mongodb.internal.operation.CommandBatchCursorHelper.MESSAGE_IF_CONCURRENT_OPERATION;
@@ -85,7 +84,7 @@ class AsyncCommandBatchCursor<T> implements AsyncAggregateResponseBatchCursor<T>
8584
this.namespace = commandCursorResult.getNamespace();
8685
this.batchSize = batchSize;
8786
this.maxTimeMS = maxTimeMS;
88-
this.decoder = notNull("decoder", decoder);
87+
this.decoder = decoder;
8988
this.comment = comment;
9089
this.maxWireVersion = connectionDescription.getMaxWireVersion();
9190
this.firstBatchEmpty = commandCursorResult.getResults().isEmpty();

driver-core/src/main/com/mongodb/internal/operation/CommandBatchCursor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444

4545
import static com.mongodb.assertions.Assertions.assertNotNull;
4646
import static com.mongodb.assertions.Assertions.assertTrue;
47-
import static com.mongodb.assertions.Assertions.notNull;
4847
import static com.mongodb.internal.VisibleForTesting.AccessModifier.PRIVATE;
4948
import static com.mongodb.internal.operation.CommandBatchCursorHelper.FIRST_BATCH;
5049
import static com.mongodb.internal.operation.CommandBatchCursorHelper.MESSAGE_IF_CLOSED_AS_CURSOR;
@@ -84,7 +83,7 @@ class CommandBatchCursor<T> implements AggregateResponseBatchCursor<T> {
8483
this.namespace = commandCursorResult.getNamespace();
8584
this.batchSize = batchSize;
8685
this.maxTimeMS = maxTimeMS;
87-
this.decoder = notNull("decoder", decoder);
86+
this.decoder = decoder;
8887
this.comment = comment;
8988
this.maxWireVersion = connectionDescription.getMaxWireVersion();
9089
this.firstBatchEmpty = commandCursorResult.getResults().isEmpty();

driver-core/src/main/com/mongodb/internal/operation/CursorResourceManager.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import static com.mongodb.assertions.Assertions.assertNull;
3232
import static com.mongodb.assertions.Assertions.assertTrue;
3333
import static com.mongodb.assertions.Assertions.fail;
34-
import static com.mongodb.assertions.Assertions.notNull;
3534
import static com.mongodb.internal.Locks.withLock;
3635
import static com.mongodb.internal.operation.CommandBatchCursorHelper.MESSAGE_IF_CONCURRENT_OPERATION;
3736

@@ -71,11 +70,11 @@ abstract class CursorResourceManager<CS extends ReferenceCounted, C extends Refe
7170
@Nullable final C connectionToPin,
7271
@Nullable final ServerCursor serverCursor) {
7372
this.lock = new ReentrantLock();
74-
this.namespace = notNull("mongoNamespace", namespace);
73+
this.namespace = namespace;
7574
this.state = State.IDLE;
7675
if (serverCursor != null) {
7776
connectionSource.retain();
78-
this.connectionSource = notNull("connectionSource", connectionSource);
77+
this.connectionSource = connectionSource;
7978
if (connectionToPin != null) {
8079
connectionToPin.retain();
8180
markAsPinned(connectionToPin, Connection.PinningMode.CURSOR);

0 commit comments

Comments
 (0)