Skip to content

Commit f43fc49

Browse files
committed
Make CursorHelper generic.
JAVA-5530
1 parent df2cb88 commit f43fc49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ static BsonDocument getCursorDocumentFromBatchSize(@Nullable final Integer batch
3333
return batchSize == null ? new BsonDocument() : new BsonDocument("batchSize", new BsonInt32(batchSize));
3434
}
3535

36-
public static void exhaustCursorAsync(final AsyncBatchCursor<BsonDocument> cursor, final SingleResultCallback<List<List<BsonDocument>>> finalCallback) {
37-
List<List<BsonDocument>> results = new ArrayList<>();
36+
public static <T> void exhaustCursorAsync(final AsyncBatchCursor<T> cursor, final SingleResultCallback<List<List<T>>> finalCallback) {
37+
List<List<T>> results = new ArrayList<>();
3838

3939
beginAsync().thenRunDoWhileLoop(iterationCallback -> {
4040
beginAsync().
@@ -46,7 +46,7 @@ public static void exhaustCursorAsync(final AsyncBatchCursor<BsonDocument> curso
4646
callback.complete(callback);
4747
}).finish(iterationCallback);
4848
}, () -> !cursor.isClosed())
49-
.<List<List<BsonDocument>>>thenSupply(callback -> {
49+
.<List<List<T>>>thenSupply(callback -> {
5050
callback.complete(results);
5151
}).finish(finalCallback);
5252
}

0 commit comments

Comments
 (0)