From 4888c4d500fc7866b8635b334302054e76c741d1 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 17 Apr 2024 15:31:36 -0700 Subject: [PATCH 1/5] Revert "Deprecate timeout options. (#1346)" This reverts commit 3f41bf43 --- config/detekt/baseline.xml | 4 +- .../main/com/mongodb/ConnectionString.java | 15 ------- .../main/com/mongodb/MongoClientSettings.java | 2 - .../src/main/com/mongodb/WriteConcern.java | 42 ------------------- .../client/model/CreateIndexOptions.java | 29 ------------- .../client/model/DropIndexOptions.java | 28 ------------- .../connection/ConnectionPoolSettings.java | 29 ------------- .../mongodb/connection/SocketSettings.java | 30 ------------- .../com/mongodb/internal/TimeoutSettings.java | 25 +---------- .../internal/capi/MongoCryptHelper.java | 1 - .../connection/DefaultConnectionPool.java | 2 - .../operation/CommitTransactionOperation.java | 1 - .../internal/operation/SyncOperations.java | 4 +- .../com/mongodb/ClusterFixture.java | 1 - .../mongodb/AbstractConnectionStringTest.java | 2 +- .../WriteConcernConnectionStringTest.java | 1 - .../com/mongodb/WriteConcernDocumentTest.java | 1 - .../connection/SocketSettingsTest.java | 1 - .../syncadapter/SyncAggregateIterable.kt | 4 +- .../syncadapter/SyncDistinctIterable.kt | 4 +- .../coroutine/syncadapter/SyncFindIterable.kt | 4 +- .../SyncListCollectionNamesIterable.kt | 2 +- .../SyncListCollectionsIterable.kt | 3 -- .../syncadapter/SyncListDatabasesIterable.kt | 2 - .../syncadapter/SyncListIndexesIterable.kt | 2 - .../SyncListSearchIndexesIterable.kt | 2 - .../kotlin/client/coroutine/ClientSession.kt | 3 +- .../client/coroutine/ListCollectionsFlow.kt | 15 +------ .../client/coroutine/ListDatabasesFlow.kt | 13 +----- .../client/coroutine/ListIndexesFlow.kt | 13 +----- .../client/coroutine/ListSearchIndexesFlow.kt | 12 ------ .../kotlin/client/coroutine/MapReduceFlow.kt | 11 +---- .../client/coroutine/MongoCollection.kt | 14 ++----- .../client/coroutine/AggregateFlowTest.kt | 9 ++-- .../client/coroutine/DistinctFlowTest.kt | 9 ++-- .../kotlin/client/coroutine/FindFlowTest.kt | 9 ++-- .../coroutine/ListCollectionsFlowTest.kt | 1 - .../client/coroutine/ListDatabasesFlowTest.kt | 1 - .../client/coroutine/ListIndexesFlowTest.kt | 1 - .../client/coroutine/MongoCollectionTest.kt | 2 - .../syncadapter/SyncAggregateIterable.kt | 4 +- .../syncadapter/SyncDistinctIterable.kt | 4 +- .../client/syncadapter/SyncFindIterable.kt | 4 +- .../SyncListCollectionNamesIterable.kt | 2 +- .../SyncListCollectionsIterable.kt | 2 - .../syncadapter/SyncListDatabasesIterable.kt | 2 - .../syncadapter/SyncListIndexesIterable.kt | 3 -- .../SyncListSearchIndexesIterable.kt | 2 - .../kotlin/client/ListCollectionsIterable.kt | 13 +----- .../kotlin/client/ListDatabasesIterable.kt | 13 +----- .../kotlin/client/ListIndexesIterable.kt | 13 +----- .../client/ListSearchIndexesIterable.kt | 13 +----- .../mongodb/kotlin/client/MongoCollection.kt | 18 +++----- .../kotlin/client/AggregateIterableTest.kt | 13 +++--- .../kotlin/client/DistinctIterableTest.kt | 11 +++-- .../mongodb/kotlin/client/FindIterableTest.kt | 13 +++--- .../client/ListCollectionsIterableTest.kt | 1 - .../client/ListDatabasesIterableTest.kt | 1 - .../kotlin/client/ListIndexesIterableTest.kt | 1 - .../kotlin/client/MongoCollectionTest.kt | 2 - .../main/com/mongodb/MongoClientOptions.java | 5 --- .../src/main/com/mongodb/MongoClientURI.java | 1 - .../com/mongodb/DBCollectionTest.java | 6 --- .../client/AggregatePublisher.java | 3 +- .../client/DistinctPublisher.java | 3 +- .../reactivestreams/client/FindPublisher.java | 3 +- .../client/ListCollectionNamesPublisher.java | 3 +- .../client/ListCollectionsPublisher.java | 17 +------- .../client/ListDatabasesPublisher.java | 17 +------- .../client/ListIndexesPublisher.java | 17 +------- .../client/MapReducePublisher.java | 15 ------- .../client/gridfs/GridFSFindPublisher.java | 17 -------- .../ListCollectionsPublisherImpl.java | 1 - .../internal/ListDatabasesPublisherImpl.java | 1 - .../internal/ListIndexesPublisherImpl.java | 1 - .../internal/crypt/KeyManagementService.java | 2 - .../syncadapter/SyncGridFSFindIterable.java | 1 - .../SyncListCollectionsIterable.java | 1 - .../SyncListDatabasesIterable.java | 1 - .../syncadapter/SyncListIndexesIterable.java | 1 - .../SyncListSearchIndexesIterable.java | 1 - .../ListCollectionsPublisherImplTest.java | 1 - .../ListDatabasesPublisherImplTest.java | 1 - .../ListIndexesPublisherImplTest.java | 1 - .../internal/MongoCollectionImplTest.java | 2 - .../mongodb/scala/AggregateObservable.scala | 3 +- .../mongodb/scala/DistinctObservable.scala | 3 +- .../org/mongodb/scala/FindObservable.scala | 3 +- .../scala/ListCollectionNamesObservable.scala | 3 +- .../scala/ListCollectionsObservable.scala | 12 ------ .../scala/ListDatabasesObservable.scala | 12 ------ .../mongodb/scala/ListIndexesObservable.scala | 12 ------ .../scala/ListSearchIndexesObservable.scala | 18 ++------ .../mongodb/scala/MapReduceObservable.scala | 11 ----- .../scala/gridfs/GridFSFindObservable.scala | 14 +------ .../internal/WriteConcernImplicits.scala | 11 ----- .../CausalConsistencyExamples.java | 1 - .../com/mongodb/client/AggregateIterable.java | 3 +- .../com/mongodb/client/DistinctIterable.java | 3 +- .../main/com/mongodb/client/FindIterable.java | 3 +- .../client/ListCollectionNamesIterable.java | 3 +- .../client/ListCollectionsIterable.java | 17 +------- .../mongodb/client/ListDatabasesIterable.java | 17 +------- .../mongodb/client/ListIndexesIterable.java | 17 +------- .../client/ListSearchIndexesIterable.java | 21 ++-------- .../com/mongodb/client/MapReduceIterable.java | 15 ------- .../client/gridfs/GridFSFindIterable.java | 17 -------- .../internal/ListCollectionsIterableImpl.java | 1 - .../internal/ListDatabasesIterableImpl.java | 1 - .../internal/ListIndexesIterableImpl.java | 1 - .../ListSearchIndexesIterableImpl.java | 1 - .../client/AbstractRetryableReadsTest.java | 1 - .../com/mongodb/client/Fixture.java | 1 - .../client/JsonPoweredCrudTestHelper.java | 1 - .../com/mongodb/client/ReadConcernTest.java | 1 - .../mongodb/client/TransactionProseTest.java | 1 - .../com/mongodb/client/unified/Entities.java | 1 - .../client/unified/UnifiedCrudHelper.java | 3 -- .../client/unified/UnifiedGridFSHelper.java | 1 - 119 files changed, 88 insertions(+), 756 deletions(-) diff --git a/config/detekt/baseline.xml b/config/detekt/baseline.xml index 8cb837ffc59..718bfeabbf1 100644 --- a/config/detekt/baseline.xml +++ b/config/detekt/baseline.xml @@ -4,8 +4,8 @@ IteratorNotThrowingNoSuchElementException:MongoCursor.kt$MongoCursor<T : Any> : IteratorCloseable LargeClass:MongoCollectionTest.kt$MongoCollectionTest - LongMethod:FindFlowTest.kt$FindFlowTest$@Test @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() - LongMethod:FindIterableTest.kt$FindIterableTest$@Test @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() + LongMethod:FindFlowTest.kt$FindFlowTest$@Test fun shouldCallTheUnderlyingMethods() + LongMethod:FindIterableTest.kt$FindIterableTest$@Test fun shouldCallTheUnderlyingMethods() LongMethod:KotlinSerializerCodecTest.kt$KotlinSerializerCodecTest$@Test fun testDataClassOptionalBsonValues() MaxLineLength:MapReduceFlow.kt$MapReduceFlow$* MaxLineLength:MapReduceIterable.kt$MapReduceIterable$* diff --git a/driver-core/src/main/com/mongodb/ConnectionString.java b/driver-core/src/main/com/mongodb/ConnectionString.java index 925479b489e..9f64db50d5a 100644 --- a/driver-core/src/main/com/mongodb/ConnectionString.java +++ b/driver-core/src/main/com/mongodb/ConnectionString.java @@ -1084,7 +1084,6 @@ private ReadPreference buildReadPreference(@Nullable final String readPreference } @Nullable - @SuppressWarnings("deprecation") //wTimeout private WriteConcern buildWriteConcern(@Nullable final Boolean safe, @Nullable final String w, @Nullable final Integer wTimeout, @Nullable final Boolean journal) { @@ -1592,21 +1591,7 @@ public Integer getConnectTimeout() { /** * Gets the socket timeout specified in the connection string. * @return the socket timeout - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this socket timeout - * irrelevant. If no timeout is specified at these levels, the socket timeout will be used. */ - @Deprecated @Nullable public Integer getSocketTimeout() { return socketTimeout; diff --git a/driver-core/src/main/com/mongodb/MongoClientSettings.java b/driver-core/src/main/com/mongodb/MongoClientSettings.java index 6dac0b05a21..9655b61b024 100644 --- a/driver-core/src/main/com/mongodb/MongoClientSettings.java +++ b/driver-core/src/main/com/mongodb/MongoClientSettings.java @@ -240,7 +240,6 @@ public static final class Builder { private Builder() { } - @SuppressWarnings("deprecation") //readTimeout private Builder(final MongoClientSettings settings) { notNull("settings", settings); applicationName = settings.getApplicationName(); @@ -1116,7 +1115,6 @@ public String toString() { + '}'; } - @SuppressWarnings("deprecation") //readTimeout private MongoClientSettings(final Builder builder) { isTrue("timeoutMS > 0 ", builder.timeoutMS == null || builder.timeoutMS >= 0); readPreference = builder.readPreference; diff --git a/driver-core/src/main/com/mongodb/WriteConcern.java b/driver-core/src/main/com/mongodb/WriteConcern.java index 1c794763e22..61c8e510b90 100644 --- a/driver-core/src/main/com/mongodb/WriteConcern.java +++ b/driver-core/src/main/com/mongodb/WriteConcern.java @@ -170,21 +170,7 @@ public WriteConcern(final String w) { * @param wTimeoutMS the wTimeout in milliseconds, which must be >= 0 * @mongodb.driver.manual reference/write-concern/#w-option w option * @mongodb.driver.manual reference/write-concern/#wtimeout wtimeout option - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering wTimeoutMS irrelevant. - * If no timeout is specified at these levels, the wTimeoutMS will be used. */ - @Deprecated public WriteConcern(final int w, final int wTimeoutMS) { this(w, wTimeoutMS, null); } @@ -246,21 +232,7 @@ public String getWString() { * @see #withWTimeout(long, TimeUnit) * @since 3.2 * @mongodb.driver.manual core/write-concern/#timeouts wTimeout - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this wTimeoutMS irrelevant. - * If no timeout is specified at these levels, the wTimeoutMS will be used. */ - @Deprecated @Nullable public Integer getWTimeout(final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); @@ -412,21 +384,7 @@ public WriteConcern withJournal(@Nullable final Boolean journal) { * @see #getWTimeout(TimeUnit) * @since 3.2 * @mongodb.driver.manual reference/write-concern/#wtimeout wtimeout option - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this wTimeoutMS irrelevant. - * If no timeout is specified at these levels, the wTimeoutMS will be used. */ - @Deprecated public WriteConcern withWTimeout(final long wTimeout, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); long newWTimeOutMS = TimeUnit.MILLISECONDS.convert(wTimeout, timeUnit); diff --git a/driver-core/src/main/com/mongodb/client/model/CreateIndexOptions.java b/driver-core/src/main/com/mongodb/client/model/CreateIndexOptions.java index 3c11ad04797..e93da219fb1 100644 --- a/driver-core/src/main/com/mongodb/client/model/CreateIndexOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/CreateIndexOptions.java @@ -18,7 +18,6 @@ import com.mongodb.CreateIndexCommitQuorum; -import com.mongodb.MongoClientSettings; import com.mongodb.lang.Nullable; import java.util.concurrent.TimeUnit; @@ -40,21 +39,7 @@ public class CreateIndexOptions { * * @param timeUnit the time unit to return the result in * @return the maximum execution time in the given time unit - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); return timeUnit.convert(maxTimeMS, TimeUnit.MILLISECONDS); @@ -66,21 +51,7 @@ public long getMaxTime(final TimeUnit timeUnit) { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public CreateIndexOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-core/src/main/com/mongodb/client/model/DropIndexOptions.java b/driver-core/src/main/com/mongodb/client/model/DropIndexOptions.java index db7eeb3666a..982a0253a3d 100644 --- a/driver-core/src/main/com/mongodb/client/model/DropIndexOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/DropIndexOptions.java @@ -17,8 +17,6 @@ package com.mongodb.client.model; -import com.mongodb.MongoClientSettings; - import java.util.concurrent.TimeUnit; import static com.mongodb.assertions.Assertions.notNull; @@ -37,20 +35,7 @@ public class DropIndexOptions { * * @param timeUnit the time unit to return the result in * @return the maximum execution time in the given time unit - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); return timeUnit.convert(maxTimeMS, TimeUnit.MILLISECONDS); @@ -62,20 +47,7 @@ public long getMaxTime(final TimeUnit timeUnit) { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public DropIndexOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-core/src/main/com/mongodb/connection/ConnectionPoolSettings.java b/driver-core/src/main/com/mongodb/connection/ConnectionPoolSettings.java index 161bebc88d5..4b85893640f 100644 --- a/driver-core/src/main/com/mongodb/connection/ConnectionPoolSettings.java +++ b/driver-core/src/main/com/mongodb/connection/ConnectionPoolSettings.java @@ -17,7 +17,6 @@ package com.mongodb.connection; import com.mongodb.ConnectionString; -import com.mongodb.MongoClientSettings; import com.mongodb.annotations.Immutable; import com.mongodb.annotations.NotThreadSafe; import com.mongodb.event.ConnectionCheckOutStartedEvent; @@ -178,21 +177,7 @@ public Builder minSize(final int minSize) { * @param timeUnit the TimeUnit for this wait period * @return this * @see #getMaxWaitTime(TimeUnit) - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum wait time - * irrelevant. If no timeout is specified at these levels, the maximum wait time will be used. */ - @Deprecated public Builder maxWaitTime(final long maxWaitTime, final TimeUnit timeUnit) { this.maxWaitTimeMS = MILLISECONDS.convert(maxWaitTime, timeUnit); return this; @@ -397,21 +382,7 @@ public int getMinSize() { * @return the maximum amount of time to wait in the given TimeUnits * @see Builder#maxWaitTime(long, TimeUnit) * @see ConnectionString#getMaxWaitTime() - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum wait time - * irrelevant. If no timeout is specified at these levels, the maximum wait time will be used. */ - @Deprecated public long getMaxWaitTime(final TimeUnit timeUnit) { return timeUnit.convert(maxWaitTimeMS, MILLISECONDS); } diff --git a/driver-core/src/main/com/mongodb/connection/SocketSettings.java b/driver-core/src/main/com/mongodb/connection/SocketSettings.java index 3bc3628f3ad..4e6890e785c 100644 --- a/driver-core/src/main/com/mongodb/connection/SocketSettings.java +++ b/driver-core/src/main/com/mongodb/connection/SocketSettings.java @@ -18,7 +18,6 @@ import com.mongodb.Block; import com.mongodb.ConnectionString; -import com.mongodb.MongoClientSettings; import com.mongodb.annotations.Immutable; import java.util.Objects; @@ -114,21 +113,7 @@ public Builder connectTimeout(final long connectTimeout, final TimeUnit timeUnit * @param timeUnit the time unit * @return this * @see #getReadTimeout(TimeUnit) - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this read timeout irrelevant. - * If no timeout is specified at these levels, the read timeout will be used. */ - @Deprecated public Builder readTimeout(final long readTimeout, final TimeUnit timeUnit) { this.readTimeoutMS = timeoutArgumentToMillis(readTimeout, timeUnit); return this; @@ -176,7 +161,6 @@ public SocketSettings.Builder applyToProxySettings(final Block - *
  • {@link MongoClientSettings.Builder#getTimeout(TimeUnit)}
  • - *
  • {@code MongoDatabase#getTimeout(TimeUnit)}
  • - *
  • {@code MongoCollection#getTimeout(TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this read timeout irrelevant. - * If no timeout is specified at these levels, the read timeout will be used. */ - @Deprecated public int getReadTimeout(final TimeUnit timeUnit) { return (int) timeUnit.convert(readTimeoutMS, MILLISECONDS); } diff --git a/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java b/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java index 9fbd191f4e8..05b5b9be09b 100644 --- a/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java +++ b/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java @@ -23,7 +23,6 @@ import java.util.concurrent.atomic.AtomicLong; import static com.mongodb.assertions.Assertions.isTrueArgument; -import static java.util.concurrent.TimeUnit.MILLISECONDS; /** * Timeout Settings. @@ -52,23 +51,6 @@ public class TimeoutSettings { public static final TimeoutSettings DEFAULT = create(MongoClientSettings.builder().build()); - @Nullable - public static Long convertAndValidateTimeoutNullable(@Nullable final Long timeout, final TimeUnit timeUnit) { - return timeout == null ? null : convertAndValidateTimeout(timeout, timeUnit, "timeout"); - } - - public static long convertAndValidateTimeout(final long timeout, final TimeUnit timeUnit) { - return convertAndValidateTimeout(timeout, timeUnit, "timeout"); - } - - public static long convertAndValidateTimeout(final long timeout, final TimeUnit timeUnit, final String fieldName) { - return isTrueArgument(fieldName + " was too small. After conversion it was rounded to 0 milliseconds, " - + " which would result in an unintended infinite timeout.", - () -> MILLISECONDS.convert(timeout, timeUnit), - (timeoutMS) -> timeout == 0 && timeoutMS == 0 || timeoutMS > 0); - } - - @SuppressWarnings("deprecation") public static TimeoutSettings create(final MongoClientSettings settings) { return new TimeoutSettings( settings.getClusterSettings().getServerSelectionTimeout(TimeUnit.MILLISECONDS), @@ -78,7 +60,6 @@ public static TimeoutSettings create(final MongoClientSettings settings) { settings.getConnectionPoolSettings().getMaxWaitTime(TimeUnit.MILLISECONDS)); } - @SuppressWarnings("deprecation") public static TimeoutSettings createHeartbeatSettings(final MongoClientSettings settings) { return new TimeoutSettings( settings.getClusterSettings().getServerSelectionTimeout(TimeUnit.MILLISECONDS), @@ -127,11 +108,7 @@ public TimeoutSettings connectionOnly() { return new TimeoutSettings(serverSelectionTimeoutMS, connectTimeoutMS, readTimeoutMS, null, maxWaitTimeMS); } - public TimeoutSettings withTimeout(@Nullable final Long timeout, final TimeUnit timeUnit) { - return withTimeoutMS(convertAndValidateTimeoutNullable(timeout, timeUnit)); - } - - TimeoutSettings withTimeoutMS(@Nullable final Long timeoutMS) { + public TimeoutSettings withTimeoutMS(@Nullable final Long timeoutMS) { return new TimeoutSettings(timeoutMS, serverSelectionTimeoutMS, connectTimeoutMS, readTimeoutMS, maxAwaitTimeMS, maxTimeMS, maxCommitTimeMS, wTimeoutMS, maxWaitTimeMS); } diff --git a/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java b/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java index 8bf8e21c6d7..bdd80562714 100644 --- a/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java +++ b/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java @@ -173,7 +173,6 @@ public static List createMongocryptdSpawnArgs(final Map return spawnArgs; } - @SuppressWarnings("deprecation") // builder.readTimeout public static MongoClientSettings createMongocryptdClientSettings(@Nullable final String connectionString) { return MongoClientSettings.builder() diff --git a/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java b/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java index 305537737b8..78db18db2dc 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java +++ b/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java @@ -207,7 +207,6 @@ public InternalConnection get(final OperationContext operationContext) { } @Override - @SuppressWarnings("deprecation") //maxWaitTime public void getAsync(final OperationContext operationContext, final SingleResultCallback callback) { StartTime checkoutStart = connectionCheckoutStarted(operationContext); Timeout maxWaitTimeout = checkoutStart.timeoutAfterOrInfiniteIfNegative(settings.getMaxWaitTime(NANOSECONDS), NANOSECONDS); @@ -487,7 +486,6 @@ private boolean expired(final long startTime, final long curTime, final long max * Send both current and deprecated events in order to preserve backwards compatibility. * Must not throw {@link Exception}s. */ - @SuppressWarnings("deprecation") // settings.getMaxWaitTime private void connectionPoolCreated(final ConnectionPoolListener connectionPoolListener, final ServerId serverId, final ConnectionPoolSettings settings) { ClusterId clusterId = serverId.getClusterId(); diff --git a/driver-core/src/main/com/mongodb/internal/operation/CommitTransactionOperation.java b/driver-core/src/main/com/mongodb/internal/operation/CommitTransactionOperation.java index 7384241474f..01cf1a4b689 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/CommitTransactionOperation.java +++ b/driver-core/src/main/com/mongodb/internal/operation/CommitTransactionOperation.java @@ -135,7 +135,6 @@ CommandCreator getCommandCreator() { } @Override - @SuppressWarnings("deprecation") //wTimeout protected Function getRetryCommandModifier() { return command -> { WriteConcern retryWriteConcern = getWriteConcern().withW("majority"); diff --git a/driver-core/src/main/com/mongodb/internal/operation/SyncOperations.java b/driver-core/src/main/com/mongodb/internal/operation/SyncOperations.java index aa0bf509484..ede32597d85 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/SyncOperations.java +++ b/driver-core/src/main/com/mongodb/internal/operation/SyncOperations.java @@ -125,12 +125,12 @@ public TimeoutSettings createTimeoutSettings(final FindOneAndUpdateOptions optio return timeoutSettings.withMaxTimeMS(options.getMaxTime(MILLISECONDS)); } - @SuppressWarnings("deprecation") // MaxTime + // TODO (CSOT) @SuppressWarnings("deprecation") // MaxTime public TimeoutSettings createTimeoutSettings(final CreateIndexOptions options) { return timeoutSettings.withMaxTimeMS(options.getMaxTime(MILLISECONDS)); } - @SuppressWarnings("deprecation") // MaxTime + // TODO (CSOT) @SuppressWarnings("deprecation") // MaxTime public TimeoutSettings createTimeoutSettings(final DropIndexOptions options) { return timeoutSettings.withMaxTimeMS(options.getMaxTime(MILLISECONDS)); } diff --git a/driver-core/src/test/functional/com/mongodb/ClusterFixture.java b/driver-core/src/test/functional/com/mongodb/ClusterFixture.java index a4c4c1e5674..4ad5600d456 100644 --- a/driver-core/src/test/functional/com/mongodb/ClusterFixture.java +++ b/driver-core/src/test/functional/com/mongodb/ClusterFixture.java @@ -477,7 +477,6 @@ private static Cluster createCluster(final MongoCredential credential, final Str LoggerSettings.builder().build(), null, null, null, Collections.emptyList(), getServerApi(), null); } - @SuppressWarnings("deprecation") //readTimeout private static Cluster createCluster(final ConnectionString connectionString, final StreamFactory streamFactory) { MongoClientSettings mongoClientSettings = MongoClientSettings.builder().applyConnectionString(connectionString).build(); diff --git a/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java b/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java index 251172a19f8..bb26a3edb53 100644 --- a/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java +++ b/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java @@ -95,7 +95,7 @@ protected void testValidHostIdentifiers() { assertExpectedHosts(connectionString.getHosts()); } - @SuppressWarnings({"ConstantConditions", "deprecation"}) + @SuppressWarnings("ConstantConditions") protected void testValidOptions() { ConnectionString connectionString = null; diff --git a/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java b/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java index e406d22e549..ec5815abfc9 100644 --- a/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java +++ b/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java @@ -64,7 +64,6 @@ public void shouldPassAllOutcomes() { } } - @SuppressWarnings("deprecation") //wTimeout private WriteConcern getExpectedWriteConcern() { BsonDocument writeConcernDocument = definition.getDocument("writeConcern"); diff --git a/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java b/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java index f90b4f405e8..1c828a42f15 100644 --- a/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java +++ b/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java @@ -63,7 +63,6 @@ public void shouldPassAllOutcomes() { } } - @SuppressWarnings("deprecation") //wTimeoutMS private WriteConcern getWriteConcern(final BsonDocument writeConcernDocument) { BsonValue wValue = writeConcernDocument.get("w"); WriteConcern retVal; diff --git a/driver-core/src/test/unit/com/mongodb/connection/SocketSettingsTest.java b/driver-core/src/test/unit/com/mongodb/connection/SocketSettingsTest.java index bca0731360d..bf092be0f54 100644 --- a/driver-core/src/test/unit/com/mongodb/connection/SocketSettingsTest.java +++ b/driver-core/src/test/unit/com/mongodb/connection/SocketSettingsTest.java @@ -31,7 +31,6 @@ void connectTimeoutThrowsIfArgumentIsTooLarge() { } @Test - @SuppressWarnings("deprecation") //readTimeout void readTimeoutThrowsIfArgumentIsTooLarge() { assertThrows(IllegalArgumentException.class, () -> SocketSettings.builder().readTimeout(Integer.MAX_VALUE / 2, TimeUnit.SECONDS)); } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt index 23fcb0660ef..afc4baec7a7 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt @@ -35,10 +35,8 @@ data class SyncAggregateIterable(val wrapped: AggregateFlow) : wrapped.allowDiskUse(allowDiskUse) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { - wrapped.maxTime(maxTime, timeUnit) + @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt index 3fe9e4463e7..f77977478be 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt @@ -27,10 +27,8 @@ data class SyncDistinctIterable(val wrapped: DistinctFlow) : JDistinctIterable, SyncMongoIterable(wrapped) { override fun batchSize(batchSize: Int): SyncDistinctIterable = apply { wrapped.batchSize(batchSize) } override fun filter(filter: Bson?): SyncDistinctIterable = apply { wrapped.filter(filter) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncDistinctIterable = apply { - wrapped.maxTime(maxTime, timeUnit) + @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) } override fun collation(collation: Collation?): SyncDistinctIterable = apply { wrapped.collation(collation) } override fun comment(comment: String?): SyncDistinctIterable = apply { wrapped.comment(comment) } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt index e1000f77dc4..d5650b1bcc4 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt @@ -39,10 +39,8 @@ data class SyncFindIterable(val wrapped: FindFlow) : JFindIterable = apply { - wrapped.maxTime(maxTime, timeUnit) + @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncFindIterable = apply { diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt index 34481ae2e48..f110a744047 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt @@ -26,8 +26,8 @@ data class SyncListCollectionNamesIterable(val wrapped: ListCollectionNamesFlow) override fun batchSize(batchSize: Int): SyncListCollectionNamesIterable = apply { wrapped.batchSize(batchSize) } + @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListCollectionNamesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt index 8d4ab239e3b..ab1853c756d 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt @@ -26,9 +26,6 @@ data class SyncListCollectionsIterable(val wrapped: ListCollectionsFlow JListCollectionsIterable, SyncMongoIterable(wrapped) { override fun batchSize(batchSize: Int): SyncListCollectionsIterable = apply { wrapped.batchSize(batchSize) } - - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListCollectionsIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt index e23aff424a9..4563dfe4a4f 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt @@ -27,8 +27,6 @@ data class SyncListDatabasesIterable(val wrapped: ListDatabasesFlow) override fun batchSize(batchSize: Int): SyncListDatabasesIterable = apply { wrapped.batchSize(batchSize) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListDatabasesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt index ee4bceedefb..0e329c7bcdd 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt @@ -24,8 +24,6 @@ import org.bson.BsonValue data class SyncListIndexesIterable(val wrapped: ListIndexesFlow) : JListIndexesIterable, SyncMongoIterable(wrapped) { override fun batchSize(batchSize: Int): SyncListIndexesIterable = apply { wrapped.batchSize(batchSize) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListIndexesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt index 09c3ee01ffc..a7df87779df 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt @@ -36,8 +36,6 @@ internal class SyncListSearchIndexesIterable(val wrapped: ListSearchInd wrapped.allowDiskUse(allowDiskUse) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListSearchIndexesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt index 829f1abf5b8..77d8ea94554 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt @@ -235,6 +235,5 @@ public class ClientSession(public val wrapped: reactiveClientSession) : jClientS * @param maxCommitTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun TransactionOptions.Builder.maxCommitTime(maxCommitTime: Long): TransactionOptions.Builder = - this.apply { maxCommitTime(maxCommitTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxCommitTime(maxCommitTime, TimeUnit.MILLISECONDS) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlow.kt index 650c298e8f1..eb5aecc7a0a 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlow.kt @@ -59,22 +59,11 @@ public class ListCollectionsFlow(private val wrapped: ListCollectionsPu /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time - * @param timeUnit the time unit, which defaults to Milliseconds + * @param timeUnit the time unit, defaults to Milliseconds * @return this + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListCollectionsFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlow.kt index a9d1fd87a67..60670429029 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlow.kt @@ -56,22 +56,11 @@ public class ListDatabasesFlow(private val wrapped: ListDatabasesPublis /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListDatabasesFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlow.kt index 6ac8678ecbf..dd736b977ff 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlow.kt @@ -55,22 +55,11 @@ public class ListIndexesFlow(private val wrapped: ListIndexesPublisher< /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListIndexesFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListSearchIndexesFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListSearchIndexesFlow.kt index a6d81e53742..0cbeaf70de9 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListSearchIndexesFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListSearchIndexesFlow.kt @@ -82,22 +82,10 @@ public class ListSearchIndexesFlow(private val wrapped: ListSearchIndex /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time. * @param timeUnit the time unit, defaults to Milliseconds. * @return this. */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListSearchIndexesFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt index e78b1f1e414..3f4a319090b 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt @@ -152,19 +152,10 @@ public class MapReduceFlow(private val wrapped: MapReducePublisher) /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/#cursor.maxTimeMS) */ public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): MapReduceFlow = apply { wrapped.maxTime(maxTime, timeUnit) diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt index aa3751762b4..d04d6579c02 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt @@ -1586,7 +1586,6 @@ public class MongoCollection(private val wrapped: JMongoCollection) * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun CreateIndexOptions.maxTime(maxTime: Long): CreateIndexOptions = this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** @@ -1603,7 +1602,6 @@ public fun CountOptions.maxTime(maxTime: Long): CountOptions = this.apply { maxT * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun DropIndexOptions.maxTime(maxTime: Long): DropIndexOptions = this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** @@ -1612,36 +1610,32 @@ public fun DropIndexOptions.maxTime(maxTime: Long): DropIndexOptions = * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun EstimatedDocumentCountOptions.maxTime(maxTime: Long): EstimatedDocumentCountOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun FindOneAndDeleteOptions.maxTime(maxTime: Long): FindOneAndDeleteOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun FindOneAndReplaceOptions.maxTime(maxTime: Long): FindOneAndReplaceOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun FindOneAndUpdateOptions.maxTime(maxTime: Long): FindOneAndUpdateOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * expireAfter extension function * diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt index a9dfaab4e47..cb108e3b927 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt @@ -46,7 +46,6 @@ class AggregateFlowTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: AggregatePublisher = mock() val flow = AggregateFlow(wrapped) @@ -71,8 +70,8 @@ class AggregateFlowTest { flow.let(bson) flow.maxAwaitTime(1) flow.maxAwaitTime(1, TimeUnit.SECONDS) - flow.maxTime(1) - flow.maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") flow.maxTime(1) + @Suppress("DEPRECATION") flow.maxTime(1, TimeUnit.SECONDS) flow.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).allowDiskUse(true) @@ -85,8 +84,8 @@ class AggregateFlowTest { verify(wrapped).hintString(hintString) verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).let(bson) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt index 1407cee09c0..32c928787ba 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt @@ -39,7 +39,6 @@ class DistinctFlowTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: DistinctPublisher = mock() val flow = DistinctFlow(wrapped) @@ -55,8 +54,8 @@ class DistinctFlowTest { flow.comment(bsonComment) flow.comment(comment) flow.filter(filter) - flow.maxTime(1) - flow.maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") flow.maxTime(1) + @Suppress("DEPRECATION") flow.maxTime(1, TimeUnit.SECONDS) flow.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).batchSize(batchSize) @@ -64,8 +63,8 @@ class DistinctFlowTest { verify(wrapped).comment(bsonComment) verify(wrapped).comment(comment) verify(wrapped).filter(filter) - verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) verifyNoMoreInteractions(wrapped) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt index c0556f7655a..d23667af9ae 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt @@ -41,7 +41,6 @@ class FindFlowTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: FindPublisher = mock() val flow = FindFlow(wrapped) @@ -70,8 +69,8 @@ class FindFlowTest { flow.max(bson) flow.maxAwaitTime(1) flow.maxAwaitTime(1, TimeUnit.SECONDS) - flow.maxTime(1) - flow.maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") flow.maxTime(1) + @Suppress("DEPRECATION") flow.maxTime(1, TimeUnit.SECONDS) flow.min(bson) flow.noCursorTimeout(true) flow.partial(true) @@ -96,8 +95,8 @@ class FindFlowTest { verify(wrapped).max(bson) verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).min(bson) verify(wrapped).noCursorTimeout(true) verify(wrapped).partial(true) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlowTest.kt index 0e00883e2ed..59c6f896c86 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionsFlowTest.kt @@ -28,7 +28,6 @@ import org.mockito.kotlin.mock import org.mockito.kotlin.verify import org.mockito.kotlin.verifyNoMoreInteractions -@Suppress("DEPRECATION") // maxTime class ListCollectionsFlowTest { @Test fun shouldHaveTheSameMethods() { diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlowTest.kt index 7e441b4c6fd..eac18960b3f 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListDatabasesFlowTest.kt @@ -28,7 +28,6 @@ import org.mockito.kotlin.mock import org.mockito.kotlin.verify import org.mockito.kotlin.verifyNoMoreInteractions -@Suppress("DEPRECATION") // maxTime class ListDatabasesFlowTest { @Test fun shouldHaveTheSameMethods() { diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlowTest.kt index 37f215c2ed3..d84765d428b 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/ListIndexesFlowTest.kt @@ -38,7 +38,6 @@ class ListIndexesFlowTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: ListIndexesPublisher = mock() val flow = ListIndexesFlow(wrapped) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt index ac2ab0669f1..d28396330b7 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt @@ -912,7 +912,6 @@ class MongoCollectionTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingDropIndex() { val mongoCollection = MongoCollection(wrapped) val indexName = "index" @@ -953,7 +952,6 @@ class MongoCollectionTest { } @Test - @Suppress("DEPRECATION") // maxtime fun shouldCallTheUnderlyingDropIndexes() { val mongoCollection = MongoCollection(wrapped) val defaultOptions = DropIndexOptions() diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt index ab097df27bb..a172419ede8 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt @@ -38,10 +38,8 @@ internal class SyncAggregateIterable(val wrapped: AggregateIterable) wrapped.allowDiskUse(allowDiskUse) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { - wrapped.maxTime(maxTime, timeUnit) + @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt index 1e4bb999944..4e6c8eba9f8 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt @@ -30,10 +30,8 @@ internal class SyncDistinctIterable(val wrapped: DistinctIterable) : wrapped.timeoutMode(timeoutMode) } override fun filter(filter: Bson?): SyncDistinctIterable = apply { wrapped.filter(filter) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncDistinctIterable = apply { - wrapped.maxTime(maxTime, timeUnit) + @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) } override fun collation(collation: Collation?): SyncDistinctIterable = apply { wrapped.collation(collation) } override fun comment(comment: String?): SyncDistinctIterable = apply { wrapped.comment(comment) } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt index 85f332137a3..9be2bcc646e 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt @@ -40,10 +40,8 @@ internal class SyncFindIterable(val wrapped: FindIterable) : wrapped.allowDiskUse(allowDiskUse) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncFindIterable = apply { - wrapped.maxTime(maxTime, timeUnit) + @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncFindIterable = apply { diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt index 729b1eb2746..7477c9c9de1 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt @@ -26,8 +26,8 @@ internal class SyncListCollectionNamesIterable(val wrapped: ListCollectionNamesI override fun batchSize(batchSize: Int): SyncListCollectionNamesIterable = apply { wrapped.batchSize(batchSize) } + @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListCollectionNamesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt index 8230bc97540..f38e7eed5e7 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt @@ -30,8 +30,6 @@ internal class SyncListCollectionsIterable(val wrapped: ListCollections wrapped.timeoutMode(timeoutMode) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListCollectionsIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt index f5e5f4aaccc..34874827826 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt @@ -30,8 +30,6 @@ internal class SyncListDatabasesIterable(val wrapped: ListDatabasesIter wrapped.timeoutMode(timeoutMode) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListDatabasesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt index e696fab8868..56e5fec91cd 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt @@ -27,9 +27,6 @@ internal class SyncListIndexesIterable(val wrapped: ListIndexesIterable override fun timeoutMode(timeoutMode: TimeoutMode): SyncListIndexesIterable = apply { wrapped.timeoutMode(timeoutMode) } - - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListIndexesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt index 495874ec189..b0e6d522b7e 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt @@ -36,8 +36,6 @@ internal class SyncListSearchIndexesIterable(val wrapped: ListSearchInd wrapped.allowDiskUse(allowDiskUse) } - @Suppress("DEPRECATION") - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.HIDDEN) override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListSearchIndexesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionsIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionsIterable.kt index 01b796c3781..8e3473aa8a4 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionsIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionsIterable.kt @@ -53,22 +53,11 @@ public class ListCollectionsIterable(private val wrapped: JListCollecti /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListCollectionsIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListDatabasesIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListDatabasesIterable.kt index 8777ab1ce41..de8be15727e 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListDatabasesIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListDatabasesIterable.kt @@ -53,22 +53,11 @@ public class ListDatabasesIterable(private val wrapped: JListDatabasesI /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListDatabasesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListIndexesIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListIndexesIterable.kt index 896ebd158d9..1fdddbd7d28 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListIndexesIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListIndexesIterable.kt @@ -51,22 +51,11 @@ public class ListIndexesIterable(private val wrapped: JListIndexesItera /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListIndexesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListSearchIndexesIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListSearchIndexesIterable.kt index 4f864548b8e..1214e8026e0 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListSearchIndexesIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListSearchIndexesIterable.kt @@ -74,22 +74,11 @@ public class ListSearchIndexesIterable(private val wrapped: JListSearch /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time. * @param timeUnit the time unit, defaults to Milliseconds. * @return this. + * @see [Max Time](https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/#cursor.maxTimeMS) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListSearchIndexesIterable = apply { wrapped.maxTime(maxTime, timeUnit) diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt index 677f73aa707..a85bdb8be2c 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt @@ -1443,7 +1443,6 @@ public class MongoCollection(private val wrapped: JMongoCollection) * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun CreateIndexOptions.maxTime(maxTime: Long): CreateIndexOptions = this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** @@ -1452,15 +1451,14 @@ public fun CreateIndexOptions.maxTime(maxTime: Long): CreateIndexOptions = * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") -public fun CountOptions.maxTime(maxTime: Long): CountOptions = this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } +public fun CountOptions.maxTime(maxTime: Long): CountOptions = + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun DropIndexOptions.maxTime(maxTime: Long): DropIndexOptions = this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** @@ -1469,36 +1467,32 @@ public fun DropIndexOptions.maxTime(maxTime: Long): DropIndexOptions = * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun EstimatedDocumentCountOptions.maxTime(maxTime: Long): EstimatedDocumentCountOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun FindOneAndDeleteOptions.maxTime(maxTime: Long): FindOneAndDeleteOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun FindOneAndReplaceOptions.maxTime(maxTime: Long): FindOneAndReplaceOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun FindOneAndUpdateOptions.maxTime(maxTime: Long): FindOneAndUpdateOptions = - this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * expireAfter extension function * diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt index 40b99d025b5..b5616a428c6 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt @@ -44,7 +44,6 @@ class AggregateIterableTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: JAggregateIterable = mock() val iterable = AggregateIterable(wrapped) @@ -79,8 +78,8 @@ class AggregateIterableTest { iterable.let(bson) iterable.maxAwaitTime(1) iterable.maxAwaitTime(1, TimeUnit.SECONDS) - iterable.maxTime(1) - iterable.maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") iterable.maxTime(1) + @Suppress("DEPRECATION") iterable.maxTime(1, TimeUnit.SECONDS) iterable.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).allowDiskUse(true) @@ -94,10 +93,10 @@ class AggregateIterableTest { verify(wrapped, times(2)).explain(BsonDocument::class.java, verbosity) verify(wrapped).hint(hint) verify(wrapped).hintString(hintString) - verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).let(bson) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt index ba56a7a0426..83863849e8f 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt @@ -40,7 +40,6 @@ class DistinctIterableTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: JDistinctIterable = mock() val iterable = DistinctIterable(wrapped) @@ -56,17 +55,17 @@ class DistinctIterableTest { iterable.comment(bsonComment) iterable.comment(comment) iterable.filter(filter) - iterable.maxTime(1) - iterable.maxTime(1, TimeUnit.SECONDS) - iterable.timeoutMode(TimeoutMode.ITERATION) + @Suppress("DEPRECATION") iterable.maxTime(1) + @Suppress("DEPRECATION") iterable.maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") iterable.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).batchSize(batchSize) verify(wrapped).collation(collation) verify(wrapped).comment(bsonComment) verify(wrapped).comment(comment) verify(wrapped).filter(filter) - verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) verifyNoMoreInteractions(wrapped) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt index b392baadc8c..1f516d34efe 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt @@ -39,7 +39,6 @@ class FindIterableTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: JFindIterable = mock() val iterable = FindIterable(wrapped) @@ -78,8 +77,8 @@ class FindIterableTest { iterable.max(bson) iterable.maxAwaitTime(1) iterable.maxAwaitTime(1, TimeUnit.SECONDS) - iterable.maxTime(1) - iterable.maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") iterable.maxTime(1) + @Suppress("DEPRECATION") iterable.maxTime(1, TimeUnit.SECONDS) iterable.min(bson) iterable.noCursorTimeout(true) iterable.partial(true) @@ -105,10 +104,10 @@ class FindIterableTest { verify(wrapped).let(bson) verify(wrapped).limit(1) verify(wrapped).max(bson) - verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - verify(wrapped).maxTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).min(bson) verify(wrapped).noCursorTimeout(true) verify(wrapped).partial(true) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionsIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionsIterableTest.kt index b158b160a4f..26dd071768c 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionsIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionsIterableTest.kt @@ -39,7 +39,6 @@ class ListCollectionsIterableTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: JListCollectionsIterable = mock() val iterable = ListCollectionsIterable(wrapped) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListDatabasesIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListDatabasesIterableTest.kt index 2beb92e7cd7..a1c95cad1a0 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListDatabasesIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListDatabasesIterableTest.kt @@ -39,7 +39,6 @@ class ListDatabasesIterableTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: JListDatabasesIterable = mock() val iterable = ListDatabasesIterable(wrapped) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListIndexesIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListIndexesIterableTest.kt index 5309f50d298..08bd5b4e685 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListIndexesIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListIndexesIterableTest.kt @@ -38,7 +38,6 @@ class ListIndexesIterableTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingMethods() { val wrapped: JListIndexesIterable = mock() val iterable = ListIndexesIterable(wrapped) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt index 54c5499d23a..2ddbb7f2b53 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt @@ -811,7 +811,6 @@ class MongoCollectionTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingDropIndex() { val mongoCollection = MongoCollection(wrapped) val indexName = "index" @@ -840,7 +839,6 @@ class MongoCollectionTest { } @Test - @Suppress("DEPRECATION") // maxTime fun shouldCallTheUnderlyingDropIndexes() { val mongoCollection = MongoCollection(wrapped) val defaultOptions = DropIndexOptions() diff --git a/driver-legacy/src/main/com/mongodb/MongoClientOptions.java b/driver-legacy/src/main/com/mongodb/MongoClientOptions.java index 602df1cecf3..8c4442f237c 100644 --- a/driver-legacy/src/main/com/mongodb/MongoClientOptions.java +++ b/driver-legacy/src/main/com/mongodb/MongoClientOptions.java @@ -196,7 +196,6 @@ public int getServerSelectionTimeout() { * * @return the maximum wait time. */ - @SuppressWarnings("deprecation") public int getMaxWaitTime() { return toIntExact(wrapped.getConnectionPoolSettings().getMaxWaitTime(MILLISECONDS)); } @@ -289,7 +288,6 @@ public int getConnectTimeout() { * * @return the socket timeout, in milliseconds */ - @SuppressWarnings("deprecation") public int getSocketTimeout() { return wrapped.getSocketSettings().getReadTimeout(MILLISECONDS); } @@ -340,7 +338,6 @@ public int getHeartbeatConnectTimeout() { * @return the heartbeat socket timeout, in milliseconds * @since 2.12 */ - @SuppressWarnings("deprecation") public int getHeartbeatSocketTimeout() { return wrapped.getHeartbeatSocketSettings().getReadTimeout(MILLISECONDS); } @@ -858,7 +855,6 @@ public Builder serverSelectionTimeout(final int serverSelectionTimeout) { * @return {@code this} * @see MongoClientOptions#getMaxWaitTime() */ - @SuppressWarnings("deprecation") public Builder maxWaitTime(final int maxWaitTime) { wrapped.applyToConnectionPoolSettings(builder -> builder.maxWaitTime(maxWaitTime, MILLISECONDS)); return this; @@ -953,7 +949,6 @@ public Builder connectTimeout(final int connectTimeout) { * @return {@code this} * @see com.mongodb.MongoClientOptions#getSocketTimeout() */ - @SuppressWarnings("deprecation") public Builder socketTimeout(final int socketTimeout) { wrapped.applyToSocketSettings(builder -> builder.readTimeout(socketTimeout, MILLISECONDS)); return this; diff --git a/driver-legacy/src/main/com/mongodb/MongoClientURI.java b/driver-legacy/src/main/com/mongodb/MongoClientURI.java index 15d2d95e7c9..51863ebd0af 100644 --- a/driver-legacy/src/main/com/mongodb/MongoClientURI.java +++ b/driver-legacy/src/main/com/mongodb/MongoClientURI.java @@ -365,7 +365,6 @@ public String getSrvServiceName() { * * @return the MongoClientOptions based on this URI. */ - @SuppressWarnings("deprecation") //proxied.getSocketTimeout public MongoClientOptions getOptions() { ReadPreference readPreference = proxied.getReadPreference(); if (readPreference != null) { diff --git a/driver-legacy/src/test/functional/com/mongodb/DBCollectionTest.java b/driver-legacy/src/test/functional/com/mongodb/DBCollectionTest.java index 66d93ed30e0..9631b4deb40 100644 --- a/driver-legacy/src/test/functional/com/mongodb/DBCollectionTest.java +++ b/driver-legacy/src/test/functional/com/mongodb/DBCollectionTest.java @@ -754,7 +754,6 @@ public void testBulkWriteException() { public void testWriteConcernExceptionOnInsert() throws UnknownHostException { assumeThat(isDiscoverableReplicaSet(), is(true)); try { - @SuppressWarnings("deprecation") WriteResult res = collection.insert(new BasicDBObject(), new WriteConcern(5).withWTimeout(1, MILLISECONDS)); fail("Write should have failed but succeeded with result " + res); } catch (WriteConcernException e) { @@ -768,7 +767,6 @@ public void testWriteConcernExceptionOnUpdate() throws UnknownHostException { ObjectId id = new ObjectId(); collection.insert(new BasicDBObject("_id", id)); try { - @SuppressWarnings("deprecation") WriteResult res = collection.update(new BasicDBObject("_id", id), new BasicDBObject("$set", new BasicDBObject("x", 1)), false, false, new WriteConcern(5).withWTimeout(1, MILLISECONDS)); fail("Write should have failed but succeeded with result " + res); @@ -780,7 +778,6 @@ public void testWriteConcernExceptionOnUpdate() throws UnknownHostException { } @Test - @SuppressWarnings("deprecation") //writeConcern public void testWriteConcernExceptionOnFindAndModify() throws UnknownHostException { assumeThat(serverVersionAtLeast(3, 2), is(true)); assumeThat(isDiscoverableReplicaSet(), is(true)); @@ -838,7 +835,6 @@ public void testWriteConcernExceptionOnFindAndModify() throws UnknownHostExcepti } @Test - @SuppressWarnings("deprecation") //writeConcern public void testWriteConcernExceptionOnUpsert() throws UnknownHostException { assumeThat(isDiscoverableReplicaSet(), is(true)); ObjectId id = new ObjectId(); @@ -854,7 +850,6 @@ public void testWriteConcernExceptionOnUpsert() throws UnknownHostException { } @Test - @SuppressWarnings("deprecation") public void testWriteConcernExceptionOnRemove() throws UnknownHostException { assumeThat(isDiscoverableReplicaSet(), is(true)); try { @@ -867,7 +862,6 @@ public void testWriteConcernExceptionOnRemove() throws UnknownHostException { } @Test - @SuppressWarnings("deprecation") //writeConcern public void testBulkWriteConcernException() throws UnknownHostException { assumeThat(isDiscoverableReplicaSet(), is(true)); try { diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java index 16c3d31c150..f55bec16eb1 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java @@ -59,8 +59,7 @@ public interface AggregatePublisher extends Publisher { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java index f59eb0dfa38..efafcb1c264 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java @@ -56,8 +56,7 @@ public interface DistinctPublisher extends Publisher { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java index 90d8111896a..888a439774f 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java @@ -85,8 +85,7 @@ public interface FindPublisher extends Publisher { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java index 9fa00167f91..e4fa49cfede 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java @@ -54,8 +54,7 @@ public interface ListCollectionNamesPublisher extends Publisher { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionsPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionsPublisher.java index 5b135e852fc..e114e714de2 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionsPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionsPublisher.java @@ -16,7 +16,6 @@ package com.mongodb.reactivestreams.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.lang.Nullable; import org.bson.BsonValue; @@ -49,22 +48,8 @@ public interface ListCollectionsPublisher extends Publisher { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. + * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time */ - @Deprecated ListCollectionsPublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListDatabasesPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListDatabasesPublisher.java index 8a539da20bc..5853f30d8ff 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListDatabasesPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListDatabasesPublisher.java @@ -17,7 +17,6 @@ package com.mongodb.reactivestreams.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.lang.Nullable; import org.bson.BsonValue; @@ -40,22 +39,8 @@ public interface ListDatabasesPublisher extends Publisher { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. + * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time */ - @Deprecated ListDatabasesPublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListIndexesPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListIndexesPublisher.java index ab1a045e3f7..e4ac214063f 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListIndexesPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListIndexesPublisher.java @@ -16,7 +16,6 @@ package com.mongodb.reactivestreams.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.lang.Nullable; import org.bson.BsonValue; @@ -38,22 +37,8 @@ public interface ListIndexesPublisher extends Publisher { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. + * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time */ - @Deprecated ListIndexesPublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java index a73fdf50e58..7f7033a723b 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java @@ -17,7 +17,6 @@ package com.mongodb.reactivestreams.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.lang.Nullable; @@ -117,21 +116,7 @@ public interface MapReducePublisher extends Publisher { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated MapReducePublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/gridfs/GridFSFindPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/gridfs/GridFSFindPublisher.java index 8482b7f7c9c..75f7a7cac10 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/gridfs/GridFSFindPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/gridfs/GridFSFindPublisher.java @@ -16,12 +16,9 @@ package com.mongodb.reactivestreams.client.gridfs; -import com.mongodb.MongoClientSettings; import com.mongodb.client.gridfs.model.GridFSFile; import com.mongodb.client.model.Collation; import com.mongodb.lang.Nullable; -import com.mongodb.reactivestreams.client.MongoCollection; -import com.mongodb.reactivestreams.client.MongoDatabase; import org.bson.conversions.Bson; import org.reactivestreams.Publisher; @@ -101,21 +98,7 @@ public interface GridFSFindPublisher extends Publisher { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated GridFSFindPublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImpl.java index 850073c60ef..057a8067ad3 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImpl.java @@ -52,7 +52,6 @@ final class ListCollectionsPublisherImpl extends BatchCursorPublisher impl this.collectionNamesOnly = collectionNamesOnly; } - @SuppressWarnings("deprecation") public ListCollectionsPublisher maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImpl.java index 635af5ffb04..b897a8bf9df 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImpl.java @@ -48,7 +48,6 @@ final class ListDatabasesPublisherImpl extends BatchCursorPublisher implem super(clientSession, mongoOperationPublisher); } - @SuppressWarnings("deprecation") public ListDatabasesPublisher maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImpl.java index be91f2db234..79e5ce2a14a 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImpl.java @@ -44,7 +44,6 @@ final class ListIndexesPublisherImpl extends BatchCursorPublisher implemen super(clientSession, mongoOperationPublisher); } - @SuppressWarnings("deprecation") public ListIndexesPublisher maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java index cd85f218ab2..8f80ea0c568 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java @@ -70,7 +70,6 @@ public void close() { tlsChannelStreamFactoryFactory.close(); } - @SuppressWarnings("deprecation") //readTimeout Mono decryptKey(final MongoKeyDecryptor keyDecryptor, @Nullable final Timeout operationTimeout) { SocketSettings socketSettings = SocketSettings.builder() .connectTimeout(timeoutMillis, MILLISECONDS) @@ -161,7 +160,6 @@ private static void handleError(final Throwable t, final OperationContext operat } } - @SuppressWarnings("deprecation") //readTimeout private OperationContext createOperationContext(@Nullable final Timeout operationTimeout, final SocketSettings socketSettings) { TimeoutSettings timeoutSettings; if (operationTimeout == null) { diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncGridFSFindIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncGridFSFindIterable.java index 8c18763fb0b..1021e6bc102 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncGridFSFindIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncGridFSFindIterable.java @@ -52,7 +52,6 @@ public GridFSFindIterable skip(final int skip) { } @Override - @SuppressWarnings("deprecation") public GridFSFindIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionsIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionsIterable.java index 390f5ac22f9..48d88963077 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionsIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionsIterable.java @@ -40,7 +40,6 @@ public ListCollectionsIterable filter(@Nullable final Bson filter) { } @Override - @SuppressWarnings("deprecation") public ListCollectionsIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListDatabasesIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListDatabasesIterable.java index 6379ec5323b..4248e59c361 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListDatabasesIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListDatabasesIterable.java @@ -34,7 +34,6 @@ class SyncListDatabasesIterable extends SyncMongoIterable implements ListD } @Override - @SuppressWarnings("deprecation") public ListDatabasesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListIndexesIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListIndexesIterable.java index 67a00672f2c..947cb8f0d0f 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListIndexesIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListIndexesIterable.java @@ -32,7 +32,6 @@ class SyncListIndexesIterable extends SyncMongoIterable implements ListInd } @Override - @Deprecated public ListIndexesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListSearchIndexesIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListSearchIndexesIterable.java index 5e503c8b9a3..f119c645916 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListSearchIndexesIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListSearchIndexesIterable.java @@ -40,7 +40,6 @@ final class SyncListSearchIndexesIterable extends SyncMongoIterable implem } @Override - @Deprecated public ListSearchIndexesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImplTest.java b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImplTest.java index be0f6a146ef..a632edbae82 100644 --- a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImplTest.java +++ b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListCollectionsPublisherImplTest.java @@ -37,7 +37,6 @@ public class ListCollectionsPublisherImplTest extends TestHelper { @DisplayName("Should build the expected ListCollectionsOperation") @Test - @SuppressWarnings("deprecation") void shouldBuildTheExpectedOperation() { TestOperationExecutor executor = createOperationExecutor(asList(getBatchCursor(), getBatchCursor())); ListCollectionsPublisher publisher = new ListCollectionsPublisherImpl<>(null, createMongoOperationPublisher(executor) diff --git a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImplTest.java b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImplTest.java index 56340014b92..c19a56f14cc 100644 --- a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImplTest.java +++ b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListDatabasesPublisherImplTest.java @@ -35,7 +35,6 @@ public class ListDatabasesPublisherImplTest extends TestHelper { @DisplayName("Should build the expected ListDatabasesOperation") @Test - @SuppressWarnings("deprecation") void shouldBuildTheExpectedOperation() { configureBatchCursor(); diff --git a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImplTest.java b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImplTest.java index 03f13cba5f5..5ae221b8a02 100644 --- a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImplTest.java +++ b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/ListIndexesPublisherImplTest.java @@ -36,7 +36,6 @@ public class ListIndexesPublisherImplTest extends TestHelper { @DisplayName("Should build the expected ListIndexesOperation") @Test - @SuppressWarnings("deprecation") void shouldBuildTheExpectedOperation() { configureBatchCursor(); diff --git a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java index 20b6706ef85..3234771af91 100644 --- a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java +++ b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java @@ -479,7 +479,6 @@ public void testDrop() { } @Test - @SuppressWarnings("deprecation") //maxTime public void testDropIndex() { String indexName = "index_name"; Bson index = Indexes.ascending("ascending_index"); @@ -539,7 +538,6 @@ public void testDropIndex() { } @Test - @SuppressWarnings("deprecation") //maxTime public void testDropIndexes() { DropIndexOptions options = new DropIndexOptions().maxTime(1, TimeUnit.MILLISECONDS); assertAll("dropIndexes", diff --git a/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala index 56f55bb25ed..f2fedd553dd 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala @@ -62,8 +62,7 @@ case class AggregateObservable[TResult](private val wrapped: AggregatePublisher[ * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] + * - [[org.mongodb.scala.ClientSession]] * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. diff --git a/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala index 749f335e4da..cc40841737a 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala @@ -45,8 +45,7 @@ case class DistinctObservable[TResult](private val wrapped: DistinctPublisher[TR * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] + * - [[org.mongodb.scala.ClientSession]] * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. diff --git a/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala index d4108e2b751..4fcfb40f38b 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala @@ -93,8 +93,7 @@ case class FindObservable[TResult](private val wrapped: FindPublisher[TResult]) * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] + * - [[org.mongodb.scala.ClientSession]] * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. diff --git a/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala index f6aba5211f0..0ced9f238bb 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala @@ -55,8 +55,7 @@ case class ListCollectionNamesObservable(wrapped: ListCollectionNamesPublisher) * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] + * - [[org.mongodb.scala.ClientSession]] * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. diff --git a/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionsObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionsObservable.scala index 758fef63ff1..553f73a069a 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionsObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionsObservable.scala @@ -48,21 +48,9 @@ case class ListCollectionsObservable[TResult](wrapped: ListCollectionsPublisher[ * Sets the maximum execution time on the server for this operation. * * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def maxTime(duration: Duration): ListCollectionsObservable[TResult] = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this diff --git a/driver-scala/src/main/scala/org/mongodb/scala/ListDatabasesObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/ListDatabasesObservable.scala index 01f0373787c..225c3c1d84e 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/ListDatabasesObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/ListDatabasesObservable.scala @@ -36,21 +36,9 @@ case class ListDatabasesObservable[TResult](wrapped: ListDatabasesPublisher[TRes * Sets the maximum execution time on the server for this operation. * * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def maxTime(duration: Duration): ListDatabasesObservable[TResult] = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this diff --git a/driver-scala/src/main/scala/org/mongodb/scala/ListIndexesObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/ListIndexesObservable.scala index 603d6661be0..e17be7b1457 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/ListIndexesObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/ListIndexesObservable.scala @@ -35,21 +35,9 @@ case class ListIndexesObservable[TResult](wrapped: ListIndexesPublisher[TResult] * Sets the maximum execution time on the server for this operation. * * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def maxTime(duration: Duration): ListIndexesObservable[TResult] = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this diff --git a/driver-scala/src/main/scala/org/mongodb/scala/ListSearchIndexesObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/ListSearchIndexesObservable.scala index add16daaa69..ef4907d60b3 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/ListSearchIndexesObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/ListSearchIndexesObservable.scala @@ -62,22 +62,10 @@ case class ListSearchIndexesObservable[TResult](wrapped: ListSearchIndexesPublis /** * Sets the maximum execution time on the server for this operation. * - * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * - * @param duration the duration - * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. + * @param duration the duration. + * @return this. + * @see [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] */ - @deprecated def maxTime(duration: Duration): ListSearchIndexesObservable[TResult] = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this diff --git a/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala index f73d48aa042..e7c8ff67de3 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala @@ -138,19 +138,8 @@ case class MapReduceObservable[TResult](wrapped: MapReducePublisher[TResult]) ex * Sets the maximum execution time on the server for this operation. * * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ def maxTime(duration: Duration): MapReduceObservable[TResult] = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) diff --git a/driver-scala/src/main/scala/org/mongodb/scala/gridfs/GridFSFindObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/gridfs/GridFSFindObservable.scala index 13834a6fbc4..fdbea9add70 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/gridfs/GridFSFindObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/gridfs/GridFSFindObservable.scala @@ -100,22 +100,10 @@ case class GridFSFindObservable(private val wrapped: GridFSFindPublisher) extend /** * Sets the maximum execution time on the server for this operation. * - * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * + * @see [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def maxTime(duration: Duration): GridFSFindObservable = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this diff --git a/driver-scala/src/main/scala/org/mongodb/scala/internal/WriteConcernImplicits.scala b/driver-scala/src/main/scala/org/mongodb/scala/internal/WriteConcernImplicits.scala index 6dbb4ddc0f4..19d3769240d 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/internal/WriteConcernImplicits.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/internal/WriteConcernImplicits.scala @@ -33,18 +33,7 @@ private[scala] trait WriteConcernImplicits { * * @param wTimeout the wTimeout, which must be >= 0 and <= Integer.MAX_VALUE after conversion to milliseconds * @return the WriteConcern with the given wTimeout - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSessionOptions]] - * - [[org.mongodb.scala.TransactionOptions]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this wTimeout - * irrelevant. If no timeout is specified at these levels, the wTimeout will be used. */ - @deprecated def withWTimeout(wTimeout: Duration): WriteConcern = jWriteConcern.withWTimeout(wTimeout.toMillis, TimeUnit.MILLISECONDS) } diff --git a/driver-sync/src/examples/documentation/CausalConsistencyExamples.java b/driver-sync/src/examples/documentation/CausalConsistencyExamples.java index 7e02e46ee4d..ab37d9c21ee 100644 --- a/driver-sync/src/examples/documentation/CausalConsistencyExamples.java +++ b/driver-sync/src/examples/documentation/CausalConsistencyExamples.java @@ -43,7 +43,6 @@ public final class CausalConsistencyExamples { * * @param args takes an optional single argument for the connection string */ - @SuppressWarnings("deprecation") public static void main(final String[] args) { MongoClientSettings clientSettings = ( args.length == 0 diff --git a/driver-sync/src/main/com/mongodb/client/AggregateIterable.java b/driver-sync/src/main/com/mongodb/client/AggregateIterable.java index 0ed775054fa..cf8a3be2474 100644 --- a/driver-sync/src/main/com/mongodb/client/AggregateIterable.java +++ b/driver-sync/src/main/com/mongodb/client/AggregateIterable.java @@ -102,8 +102,7 @@ public interface AggregateIterable extends MongoIterable { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-sync/src/main/com/mongodb/client/DistinctIterable.java b/driver-sync/src/main/com/mongodb/client/DistinctIterable.java index d95e48c7a6a..07ec37e8ee2 100644 --- a/driver-sync/src/main/com/mongodb/client/DistinctIterable.java +++ b/driver-sync/src/main/com/mongodb/client/DistinctIterable.java @@ -55,8 +55,7 @@ public interface DistinctIterable extends MongoIterable { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-sync/src/main/com/mongodb/client/FindIterable.java b/driver-sync/src/main/com/mongodb/client/FindIterable.java index fbf97460c15..ecc03e33605 100644 --- a/driver-sync/src/main/com/mongodb/client/FindIterable.java +++ b/driver-sync/src/main/com/mongodb/client/FindIterable.java @@ -77,8 +77,7 @@ public interface FindIterable extends MongoIterable { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java b/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java index be0ee189c95..a9547128e76 100644 --- a/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java +++ b/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java @@ -52,8 +52,7 @@ public interface ListCollectionNamesIterable extends MongoIterable { *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • + *
  • {@link ClientSession}
  • * * * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time diff --git a/driver-sync/src/main/com/mongodb/client/ListCollectionsIterable.java b/driver-sync/src/main/com/mongodb/client/ListCollectionsIterable.java index 2348241e594..6e7b7284f83 100644 --- a/driver-sync/src/main/com/mongodb/client/ListCollectionsIterable.java +++ b/driver-sync/src/main/com/mongodb/client/ListCollectionsIterable.java @@ -16,7 +16,6 @@ package com.mongodb.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.lang.Nullable; import org.bson.BsonValue; @@ -48,22 +47,8 @@ public interface ListCollectionsIterable extends MongoIterable * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. + * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time */ - @Deprecated ListCollectionsIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/ListDatabasesIterable.java b/driver-sync/src/main/com/mongodb/client/ListDatabasesIterable.java index f73babb9502..0bd4693279d 100644 --- a/driver-sync/src/main/com/mongodb/client/ListDatabasesIterable.java +++ b/driver-sync/src/main/com/mongodb/client/ListDatabasesIterable.java @@ -16,7 +16,6 @@ package com.mongodb.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.lang.Nullable; import org.bson.BsonValue; @@ -38,22 +37,8 @@ public interface ListDatabasesIterable extends MongoIterable { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. + * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time */ - @Deprecated ListDatabasesIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/ListIndexesIterable.java b/driver-sync/src/main/com/mongodb/client/ListIndexesIterable.java index bb14743950a..34551441131 100644 --- a/driver-sync/src/main/com/mongodb/client/ListIndexesIterable.java +++ b/driver-sync/src/main/com/mongodb/client/ListIndexesIterable.java @@ -16,7 +16,6 @@ package com.mongodb.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.lang.Nullable; import org.bson.BsonValue; @@ -37,22 +36,8 @@ public interface ListIndexesIterable extends MongoIterable { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. + * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time */ - @Deprecated ListIndexesIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/ListSearchIndexesIterable.java b/driver-sync/src/main/com/mongodb/client/ListSearchIndexesIterable.java index bbf5af9c52c..2aa82ea3fd6 100644 --- a/driver-sync/src/main/com/mongodb/client/ListSearchIndexesIterable.java +++ b/driver-sync/src/main/com/mongodb/client/ListSearchIndexesIterable.java @@ -17,7 +17,6 @@ package com.mongodb.client; import com.mongodb.ExplainVerbosity; -import com.mongodb.MongoClientSettings; import com.mongodb.annotations.Evolving; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; @@ -67,25 +66,11 @@ public interface ListSearchIndexesIterable extends MongoIterable - *
  • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
  • - *
  • {@link MongoDatabase#withTimeout(long, TimeUnit)}
  • - *
  • {@link MongoCollection#withTimeout(long, TimeUnit)}
  • - *
  • {@link com.mongodb.ClientSessionOptions}
  • - *
  • {@link com.mongodb.TransactionOptions}
  • - * - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated ListSearchIndexesIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java b/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java index 9a07e356cd6..0b28fde91ee 100644 --- a/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java +++ b/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java @@ -16,7 +16,6 @@ package com.mongodb.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.lang.Nullable; @@ -128,21 +127,7 @@ public interface MapReduceIterable extends MongoIterable { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated MapReduceIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterable.java b/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterable.java index a3df237a132..9b8cb8b9117 100644 --- a/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterable.java +++ b/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterable.java @@ -16,9 +16,6 @@ package com.mongodb.client.gridfs; -import com.mongodb.MongoClientSettings; -import com.mongodb.client.MongoCollection; -import com.mongodb.client.MongoDatabase; import com.mongodb.client.MongoIterable; import com.mongodb.client.gridfs.model.GridFSFile; import com.mongodb.client.model.Collation; @@ -95,21 +92,7 @@ public interface GridFSFindIterable extends MongoIterable { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link com.mongodb.ClientSessionOptions}
    • - *
    • {@link com.mongodb.TransactionOptions}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated GridFSFindIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/internal/ListCollectionsIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/ListCollectionsIterableImpl.java index 1f9e7f2da47..7d617947077 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/ListCollectionsIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/ListCollectionsIterableImpl.java @@ -65,7 +65,6 @@ public ListCollectionsIterable filter(@Nullable final Bson filter) { } @Override - @SuppressWarnings("deprecation") public ListCollectionsIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-sync/src/main/com/mongodb/client/internal/ListDatabasesIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/ListDatabasesIterableImpl.java index 9a6908393d4..83bc08b3dd1 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/ListDatabasesIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/ListDatabasesIterableImpl.java @@ -59,7 +59,6 @@ public ListDatabasesIterableImpl(@Nullable final ClientSession clientSession, fi } @Override - @Deprecated public ListDatabasesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-sync/src/main/com/mongodb/client/internal/ListIndexesIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/ListIndexesIterableImpl.java index 42883232a0d..19be1bdc8ed 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/ListIndexesIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/ListIndexesIterableImpl.java @@ -52,7 +52,6 @@ class ListIndexesIterableImpl extends MongoIterableImpl implem } @Override - @SuppressWarnings("deprecation") public ListIndexesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-sync/src/main/com/mongodb/client/internal/ListSearchIndexesIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/ListSearchIndexesIterableImpl.java index e1974381c07..c67106d357d 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/ListSearchIndexesIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/ListSearchIndexesIterableImpl.java @@ -87,7 +87,6 @@ public ListSearchIndexesIterable timeoutMode(final TimeoutMode timeoutM } @Override - @SuppressWarnings("deprecation") public ListSearchIndexesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractRetryableReadsTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractRetryableReadsTest.java index e2f1e58c69f..34620130a40 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractRetryableReadsTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractRetryableReadsTest.java @@ -113,7 +113,6 @@ protected BsonDocument getDefinition() { } @Before - @SuppressWarnings("deprecation") //maxTimeMS public void setUp() { assumeFalse(skipTest); assumeTrue("Skipping test: " + definition.getString("skipReason", new BsonString("")).getValue(), diff --git a/driver-sync/src/test/functional/com/mongodb/client/Fixture.java b/driver-sync/src/test/functional/com/mongodb/client/Fixture.java index ab25de05560..3b0d45dca88 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/Fixture.java +++ b/driver-sync/src/test/functional/com/mongodb/client/Fixture.java @@ -93,7 +93,6 @@ public static MongoClientSettings.Builder getMultiMongosMongoClientSettingsBuild return getMongoClientSettings(requireNonNull(getMultiMongosConnectionString())); } - @SuppressWarnings("deprecation") //readTimeout public static MongoClientSettings.Builder getMongoClientSettings(final ConnectionString connectionString) { MongoClientSettings.Builder builder = MongoClientSettings.builder() .applyConnectionString(connectionString) diff --git a/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java b/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java index 3d6dcf78608..924b96b7151 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java @@ -1315,7 +1315,6 @@ ReadPreference getReadPreference(final BsonDocument arguments) { arguments.getDocument("readPreference").getString("mode").getValue()); } - @SuppressWarnings("deprecation") //wTimeoutMS WriteConcern getWriteConcern(final BsonDocument arguments) { WriteConcern writeConcern = WriteConcern.ACKNOWLEDGED; BsonDocument writeConcernDocument = arguments.getDocument("writeConcern"); diff --git a/driver-sync/src/test/functional/com/mongodb/client/ReadConcernTest.java b/driver-sync/src/test/functional/com/mongodb/client/ReadConcernTest.java index 8f22d15cafd..a40b258ea6c 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ReadConcernTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ReadConcernTest.java @@ -41,7 +41,6 @@ public class ReadConcernTest { private TestCommandListener commandListener; @Before - @SuppressWarnings("deprecation") public void setUp() { assumeTrue(canRunTests()); diff --git a/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java index c4d9e7fac23..5ea180b312d 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java @@ -41,7 +41,6 @@ public class TransactionProseTest { private MongoCollection collection; @Before - @SuppressWarnings("deprecation") //readTimeout public void setUp() { assumeTrue(canRunTests()); MongoClientSettings.Builder builder = MongoClientSettings.builder() diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java b/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java index 0210bb72769..88c416ea5c6 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java @@ -368,7 +368,6 @@ private void initThread(final String id) { tasks.put(id, new ArrayList<>()); } - @SuppressWarnings("deprecation") //maxTimeMS & wTimeoutMS private void initClient(final BsonDocument entity, final String id, final Function mongoClientSupplier, final boolean waitForPoolAsyncWorkManagerStart) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java index 4c2e1042268..af1ef3d61b8 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java @@ -270,7 +270,6 @@ OperationResult executeListDatabaseNames(final BsonDocument operation) { new BsonArray(iterable.into(new ArrayList<>()).stream().map(BsonString::new).collect(toList()))); } - @SuppressWarnings("deprecation") //maxTimeMS OperationResult executeListCollections(final BsonDocument operation) { MongoDatabase database = getMongoDatabase(operation); BsonDocument arguments = operation.getDocument("arguments", new BsonDocument()); @@ -348,7 +347,6 @@ OperationResult executeListIndexNames(final BsonDocument operation) { }); } - @SuppressWarnings("deprecation") //maxTimeMS private ListIndexesIterable createListIndexesIterable(final BsonDocument operation) { MongoCollection collection = getMongoCollection(operation); BsonDocument arguments = operation.getDocument("arguments", new BsonDocument()); @@ -1688,7 +1686,6 @@ public OperationResult executeDropIndexes(final BsonDocument operation) { }); } - @SuppressWarnings("deprecation") //options.maxTime private static DropIndexOptions getDropIndexOptions(final BsonDocument arguments) { DropIndexOptions options = new DropIndexOptions(); for (Map.Entry cur : arguments.entrySet()) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSHelper.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSHelper.java index bbc7e6475c9..13e95a58463 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSHelper.java @@ -228,7 +228,6 @@ private GridFSBucket getGridFsBucket(final BsonDocument operation) { return bucket; } - @SuppressWarnings("deprecation") //MaxTimeMS private GridFSFindIterable createGridFSFindIterable(final BsonDocument operation) { GridFSBucket bucket = getGridFsBucket(operation); From 304409987df24995f6b1ab0eb3907afff67ae850 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 17 Apr 2024 15:31:54 -0700 Subject: [PATCH 2/5] Revert "Deprecated ListCollectionNamesIterable#maxTime" This reverts commit b2d70922aebb54df21c1e7a1e7263ce7da1f79d8. --- .../mongodb/client/ListCollectionNamesIterable.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java b/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java index a9547128e76..94cfd7c52e3 100644 --- a/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java +++ b/driver-sync/src/main/com/mongodb/client/ListCollectionNamesIterable.java @@ -16,7 +16,6 @@ package com.mongodb.client; -import com.mongodb.MongoClientSettings; import com.mongodb.lang.Nullable; import org.bson.BsonValue; import org.bson.conversions.Bson; @@ -46,19 +45,7 @@ public interface ListCollectionNamesIterable extends MongoIterable { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated ListCollectionNamesIterable maxTime(long maxTime, TimeUnit timeUnit); /** From 0b5b8e10f54421cb093a5c582efa032381f20806 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 17 Apr 2024 15:39:17 -0700 Subject: [PATCH 3/5] Revert "Deprecate options: maxTimeMS, maxCommitTimeMS for CRUD methods. (#1277)" This reverts commit 1a3e3a82 --- .../main/com/mongodb/TransactionOptions.java | 14 ---------- .../mongodb/client/model/CountOptions.java | 26 ------------------- .../model/EstimatedDocumentCountOptions.java | 26 ------------------- .../client/model/FindOneAndDeleteOptions.java | 26 ------------------- .../model/FindOneAndReplaceOptions.java | 26 ------------------- .../client/model/FindOneAndUpdateOptions.java | 26 ------------------- .../internal/client/model/FindOptions.java | 4 --- .../syncadapter/SyncAggregateIterable.kt | 2 +- .../syncadapter/SyncDistinctIterable.kt | 2 +- .../coroutine/syncadapter/SyncFindIterable.kt | 2 +- .../kotlin/client/coroutine/AggregateFlow.kt | 12 --------- .../kotlin/client/coroutine/ClientSession.kt | 2 +- .../kotlin/client/coroutine/DistinctFlow.kt | 12 --------- .../kotlin/client/coroutine/FindFlow.kt | 12 --------- .../client/coroutine/MongoCollection.kt | 9 +++---- .../client/coroutine/AggregateFlowTest.kt | 8 +++--- .../client/coroutine/DistinctFlowTest.kt | 8 +++--- .../kotlin/client/coroutine/FindFlowTest.kt | 8 +++--- .../client/coroutine/MongoCollectionTest.kt | 1 - .../syncadapter/SyncAggregateIterable.kt | 2 +- .../syncadapter/SyncDistinctIterable.kt | 2 +- .../client/syncadapter/SyncFindIterable.kt | 2 +- .../kotlin/client/AggregateIterable.kt | 12 --------- .../mongodb/kotlin/client/ClientSession.kt | 2 +- .../mongodb/kotlin/client/DistinctIterable.kt | 12 --------- .../com/mongodb/kotlin/client/FindIterable.kt | 12 --------- .../mongodb/kotlin/client/MongoCollection.kt | 11 ++++---- .../kotlin/client/AggregateIterableTest.kt | 12 ++++----- .../kotlin/client/DistinctIterableTest.kt | 10 +++---- .../mongodb/kotlin/client/FindIterableTest.kt | 12 ++++----- .../kotlin/client/MongoCollectionTest.kt | 1 - .../client/AggregatePublisher.java | 14 ---------- .../client/DistinctPublisher.java | 14 ---------- .../reactivestreams/client/FindPublisher.java | 14 ---------- .../internal/AggregatePublisherImpl.java | 1 - .../internal/DistinctPublisherImpl.java | 1 - .../client/internal/FindPublisherImpl.java | 1 - .../gridfs/GridFSFindPublisherImpl.java | 1 - .../syncadapter/SyncAggregateIterable.java | 1 - .../syncadapter/SyncDistinctIterable.java | 1 - .../client/syncadapter/SyncFindIterable.java | 1 - .../internal/AggregatePublisherImplTest.java | 3 --- .../internal/FindPublisherImplTest.java | 1 - .../internal/MongoCollectionImplTest.java | 1 - .../mongodb/scala/AggregateObservable.scala | 11 -------- .../mongodb/scala/DistinctObservable.scala | 11 -------- .../org/mongodb/scala/FindObservable.scala | 11 -------- .../com/mongodb/client/AggregateIterable.java | 14 ---------- .../com/mongodb/client/DistinctIterable.java | 14 ---------- .../main/com/mongodb/client/FindIterable.java | 14 ---------- .../client/gridfs/GridFSFindIterableImpl.java | 1 - .../internal/AggregateIterableImpl.java | 1 - .../client/internal/DistinctIterableImpl.java | 1 - .../client/internal/FindIterableImpl.java | 1 - .../client/internal/MongoCollectionImpl.java | 3 +-- .../client/JsonPoweredCrudTestHelper.java | 2 -- .../com/mongodb/client/unified/Entities.java | 1 - .../client/unified/UnifiedCrudHelper.java | 3 --- 58 files changed, 47 insertions(+), 411 deletions(-) diff --git a/driver-core/src/main/com/mongodb/TransactionOptions.java b/driver-core/src/main/com/mongodb/TransactionOptions.java index a3ef77a6164..536c55eb44f 100644 --- a/driver-core/src/main/com/mongodb/TransactionOptions.java +++ b/driver-core/src/main/com/mongodb/TransactionOptions.java @@ -258,21 +258,7 @@ public Builder readPreference(@Nullable final ReadPreference readPreference) { * @return this * @mongodb.server.release 4.2 * @since 3.11 - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    • {@code TransactionOptions.Builder#timeout(long, TimeUnit)}
    • - *
    - * - * When executing a commit transaction operation, any explicitly set timeout at these levels takes precedence, rendering this - * commit time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public Builder maxCommitTime(@Nullable final Long maxCommitTime, final TimeUnit timeUnit) { if (maxCommitTime == null) { this.maxCommitTimeMS = null; diff --git a/driver-core/src/main/com/mongodb/client/model/CountOptions.java b/driver-core/src/main/com/mongodb/client/model/CountOptions.java index 1711b9dd96a..17888908f8d 100644 --- a/driver-core/src/main/com/mongodb/client/model/CountOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/CountOptions.java @@ -133,20 +133,7 @@ public CountOptions skip(final int skip) { * * @param timeUnit the time unit to return the result in * @return the maximum execution time in the given time unit - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); return timeUnit.convert(maxTimeMS, TimeUnit.MILLISECONDS); @@ -158,20 +145,7 @@ public long getMaxTime(final TimeUnit timeUnit) { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public CountOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-core/src/main/com/mongodb/client/model/EstimatedDocumentCountOptions.java b/driver-core/src/main/com/mongodb/client/model/EstimatedDocumentCountOptions.java index 8a7d996c19a..a69e9e58a5d 100644 --- a/driver-core/src/main/com/mongodb/client/model/EstimatedDocumentCountOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/EstimatedDocumentCountOptions.java @@ -39,20 +39,7 @@ public class EstimatedDocumentCountOptions { * * @param timeUnit the time unit to return the result in * @return the maximum execution time in the given time unit - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); return timeUnit.convert(maxTimeMS, TimeUnit.MILLISECONDS); @@ -64,20 +51,7 @@ public long getMaxTime(final TimeUnit timeUnit) { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public EstimatedDocumentCountOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-core/src/main/com/mongodb/client/model/FindOneAndDeleteOptions.java b/driver-core/src/main/com/mongodb/client/model/FindOneAndDeleteOptions.java index 9095767d39d..3b25cb69692 100644 --- a/driver-core/src/main/com/mongodb/client/model/FindOneAndDeleteOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/FindOneAndDeleteOptions.java @@ -96,20 +96,7 @@ public FindOneAndDeleteOptions sort(@Nullable final Bson sort) { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public FindOneAndDeleteOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); @@ -121,20 +108,7 @@ public FindOneAndDeleteOptions maxTime(final long maxTime, final TimeUnit timeUn * * @param timeUnit the time unit for the result * @return the max time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { return timeUnit.convert(maxTimeMS, MILLISECONDS); } diff --git a/driver-core/src/main/com/mongodb/client/model/FindOneAndReplaceOptions.java b/driver-core/src/main/com/mongodb/client/model/FindOneAndReplaceOptions.java index d26b4a742ad..fe17d4f24bd 100644 --- a/driver-core/src/main/com/mongodb/client/model/FindOneAndReplaceOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/FindOneAndReplaceOptions.java @@ -139,20 +139,7 @@ public FindOneAndReplaceOptions returnDocument(final ReturnDocument returnDocume * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public FindOneAndReplaceOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); @@ -164,20 +151,7 @@ public FindOneAndReplaceOptions maxTime(final long maxTime, final TimeUnit timeU * * @param timeUnit the time unit for the result * @return the max time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { return timeUnit.convert(maxTimeMS, MILLISECONDS); } diff --git a/driver-core/src/main/com/mongodb/client/model/FindOneAndUpdateOptions.java b/driver-core/src/main/com/mongodb/client/model/FindOneAndUpdateOptions.java index b6fde4fe84a..a850bdcc0f2 100644 --- a/driver-core/src/main/com/mongodb/client/model/FindOneAndUpdateOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/FindOneAndUpdateOptions.java @@ -142,20 +142,7 @@ public FindOneAndUpdateOptions returnDocument(final ReturnDocument returnDocumen * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public FindOneAndUpdateOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit); @@ -167,20 +154,7 @@ public FindOneAndUpdateOptions maxTime(final long maxTime, final TimeUnit timeUn * * @param timeUnit the time unit for the result * @return the max time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@code MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@code MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@code MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@code ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { return timeUnit.convert(maxTimeMS, MILLISECONDS); } diff --git a/driver-core/src/main/com/mongodb/internal/client/model/FindOptions.java b/driver-core/src/main/com/mongodb/internal/client/model/FindOptions.java index 47ab7b08688..e2f92029950 100644 --- a/driver-core/src/main/com/mongodb/internal/client/model/FindOptions.java +++ b/driver-core/src/main/com/mongodb/internal/client/model/FindOptions.java @@ -149,9 +149,7 @@ public FindOptions skip(final int skip) { * @param timeUnit the time unit to return the result in * @return the maximum execution time in the given time unit * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * @deprecated This option is deprecated in favor of global operation timeout. */ - @Deprecated public long getMaxTime(final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); return timeUnit.convert(maxTimeMS, TimeUnit.MILLISECONDS); @@ -164,9 +162,7 @@ public long getMaxTime(final TimeUnit timeUnit) { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * @deprecated This option is deprecated in favor of global operation timeout. */ - @Deprecated public FindOptions maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); isTrueArgument("maxTime > = 0", maxTime >= 0); diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt index afc4baec7a7..439a0ccbb29 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt @@ -36,7 +36,7 @@ data class SyncAggregateIterable(val wrapped: AggregateFlow) : } override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { - @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) + wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt index f77977478be..0fdc879d610 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt @@ -28,7 +28,7 @@ data class SyncDistinctIterable(val wrapped: DistinctFlow) : override fun batchSize(batchSize: Int): SyncDistinctIterable = apply { wrapped.batchSize(batchSize) } override fun filter(filter: Bson?): SyncDistinctIterable = apply { wrapped.filter(filter) } override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncDistinctIterable = apply { - @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) + wrapped.maxTime(maxTime, timeUnit) } override fun collation(collation: Collation?): SyncDistinctIterable = apply { wrapped.collation(collation) } override fun comment(comment: String?): SyncDistinctIterable = apply { wrapped.comment(comment) } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt index d5650b1bcc4..6c500a9cf90 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt @@ -40,7 +40,7 @@ data class SyncFindIterable(val wrapped: FindFlow) : JFindIterable = apply { - @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) + wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncFindIterable = apply { diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt index 6289e26a164..46e18b50aec 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt @@ -81,23 +81,11 @@ public class AggregateFlow(private val wrapped: AggregatePublisher) /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this * @see [Max Time](https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/#cursor.maxTimeMS) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): AggregateFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt index 77d8ea94554..ee93a35ba64 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt @@ -236,4 +236,4 @@ public class ClientSession(public val wrapped: reactiveClientSession) : jClientS * @return the options */ public fun TransactionOptions.Builder.maxCommitTime(maxCommitTime: Long): TransactionOptions.Builder = - this.apply { @Suppress("DEPRECATION") maxCommitTime(maxCommitTime, TimeUnit.MILLISECONDS) } + this.apply { maxCommitTime(maxCommitTime, TimeUnit.MILLISECONDS) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlow.kt index e97f166bc7a..c687eea7c5b 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlow.kt @@ -66,22 +66,10 @@ public class DistinctFlow(private val wrapped: DistinctPublisher) : /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, which defaults to Milliseconds * @return this */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): DistinctFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/FindFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/FindFlow.kt index 888569bbb5d..ee2cc4706d3 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/FindFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/FindFlow.kt @@ -93,22 +93,10 @@ public class FindFlow(private val wrapped: FindPublisher) : Flow /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, which defaults to Milliseconds * @return this */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): FindFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt index d04d6579c02..d5aecaba080 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollection.kt @@ -1594,7 +1594,6 @@ public fun CreateIndexOptions.maxTime(maxTime: Long): CreateIndexOptions = * @param maxTime time in milliseconds * @return the options */ -@Suppress("DEPRECATION") public fun CountOptions.maxTime(maxTime: Long): CountOptions = this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function @@ -1611,7 +1610,7 @@ public fun DropIndexOptions.maxTime(maxTime: Long): DropIndexOptions = * @return the options */ public fun EstimatedDocumentCountOptions.maxTime(maxTime: Long): EstimatedDocumentCountOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * @@ -1619,7 +1618,7 @@ public fun EstimatedDocumentCountOptions.maxTime(maxTime: Long): EstimatedDocume * @return the options */ public fun FindOneAndDeleteOptions.maxTime(maxTime: Long): FindOneAndDeleteOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * @@ -1627,7 +1626,7 @@ public fun FindOneAndDeleteOptions.maxTime(maxTime: Long): FindOneAndDeleteOptio * @return the options */ public fun FindOneAndReplaceOptions.maxTime(maxTime: Long): FindOneAndReplaceOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * @@ -1635,7 +1634,7 @@ public fun FindOneAndReplaceOptions.maxTime(maxTime: Long): FindOneAndReplaceOpt * @return the options */ public fun FindOneAndUpdateOptions.maxTime(maxTime: Long): FindOneAndUpdateOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * expireAfter extension function * diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt index cb108e3b927..07953277d5a 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt @@ -70,8 +70,8 @@ class AggregateFlowTest { flow.let(bson) flow.maxAwaitTime(1) flow.maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") flow.maxTime(1) - @Suppress("DEPRECATION") flow.maxTime(1, TimeUnit.SECONDS) + flow.maxTime(1) + flow.maxTime(1, TimeUnit.SECONDS) flow.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).allowDiskUse(true) @@ -84,8 +84,8 @@ class AggregateFlowTest { verify(wrapped).hintString(hintString) verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) + verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).let(bson) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt index 32c928787ba..571c6f579bb 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/DistinctFlowTest.kt @@ -54,8 +54,8 @@ class DistinctFlowTest { flow.comment(bsonComment) flow.comment(comment) flow.filter(filter) - @Suppress("DEPRECATION") flow.maxTime(1) - @Suppress("DEPRECATION") flow.maxTime(1, TimeUnit.SECONDS) + flow.maxTime(1) + flow.maxTime(1, TimeUnit.SECONDS) flow.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).batchSize(batchSize) @@ -63,8 +63,8 @@ class DistinctFlowTest { verify(wrapped).comment(bsonComment) verify(wrapped).comment(comment) verify(wrapped).filter(filter) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) + verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) verifyNoMoreInteractions(wrapped) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt index d23667af9ae..450059c8211 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/FindFlowTest.kt @@ -69,8 +69,8 @@ class FindFlowTest { flow.max(bson) flow.maxAwaitTime(1) flow.maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") flow.maxTime(1) - @Suppress("DEPRECATION") flow.maxTime(1, TimeUnit.SECONDS) + flow.maxTime(1) + flow.maxTime(1, TimeUnit.SECONDS) flow.min(bson) flow.noCursorTimeout(true) flow.partial(true) @@ -95,8 +95,8 @@ class FindFlowTest { verify(wrapped).max(bson) verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) + verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).min(bson) verify(wrapped).noCursorTimeout(true) verify(wrapped).partial(true) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt index d28396330b7..7be5c068a84 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MongoCollectionTest.kt @@ -1005,7 +1005,6 @@ class MongoCollectionTest { } @Test - @Suppress("DEPRECATION") fun shouldProvideExtensionFunctionsForTimeBasedOptions() { val oneThousand = 1000L diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt index a172419ede8..b563c67c368 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt @@ -39,7 +39,7 @@ internal class SyncAggregateIterable(val wrapped: AggregateIterable) } override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { - @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) + wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncAggregateIterable = apply { diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt index 4e6c8eba9f8..91cf8165a3a 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt @@ -31,7 +31,7 @@ internal class SyncDistinctIterable(val wrapped: DistinctIterable) : } override fun filter(filter: Bson?): SyncDistinctIterable = apply { wrapped.filter(filter) } override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncDistinctIterable = apply { - @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) + wrapped.maxTime(maxTime, timeUnit) } override fun collation(collation: Collation?): SyncDistinctIterable = apply { wrapped.collation(collation) } override fun comment(comment: String?): SyncDistinctIterable = apply { wrapped.comment(comment) } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt index 9be2bcc646e..81247aeb2a0 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt @@ -41,7 +41,7 @@ internal class SyncFindIterable(val wrapped: FindIterable) : } override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncFindIterable = apply { - @Suppress("DEPRECATION") wrapped.maxTime(maxTime, timeUnit) + wrapped.maxTime(maxTime, timeUnit) } override fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): SyncFindIterable = apply { diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt index efa618c5de4..cf27c638ad3 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt @@ -78,23 +78,11 @@ public class AggregateIterable(private val wrapped: JAggregateIterable< /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this * @see [Max Time](https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/#cursor.maxTimeMS) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): AggregateIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ClientSession.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ClientSession.kt index 620007e113a..9103689b251 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ClientSession.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ClientSession.kt @@ -95,4 +95,4 @@ public class ClientSession(public val wrapped: JClientSession) : Closeable { * @return the options */ public fun TransactionOptions.Builder.maxCommitTime(maxCommitTime: Long): TransactionOptions.Builder = - this.apply { @Suppress("DEPRECATION") maxCommitTime(maxCommitTime, TimeUnit.MILLISECONDS) } + this.apply { maxCommitTime(maxCommitTime, TimeUnit.MILLISECONDS) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/DistinctIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/DistinctIterable.kt index cfc23189ef3..0ca445adde9 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/DistinctIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/DistinctIterable.kt @@ -63,22 +63,10 @@ public class DistinctIterable(private val wrapped: JDistinctIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/FindIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/FindIterable.kt index 0ad2453a4d4..6e0a895dd1a 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/FindIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/FindIterable.kt @@ -88,22 +88,10 @@ public class FindIterable(private val wrapped: JFindIterable) : Mong /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, which defaults to Milliseconds * @return this */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): FindIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt index a85bdb8be2c..87816e08383 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt @@ -1451,8 +1451,7 @@ public fun CreateIndexOptions.maxTime(maxTime: Long): CreateIndexOptions = * @param maxTime time in milliseconds * @return the options */ -public fun CountOptions.maxTime(maxTime: Long): CountOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } +public fun CountOptions.maxTime(maxTime: Long): CountOptions = this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * @@ -1468,7 +1467,7 @@ public fun DropIndexOptions.maxTime(maxTime: Long): DropIndexOptions = * @return the options */ public fun EstimatedDocumentCountOptions.maxTime(maxTime: Long): EstimatedDocumentCountOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * @@ -1476,7 +1475,7 @@ public fun EstimatedDocumentCountOptions.maxTime(maxTime: Long): EstimatedDocume * @return the options */ public fun FindOneAndDeleteOptions.maxTime(maxTime: Long): FindOneAndDeleteOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * @@ -1484,7 +1483,7 @@ public fun FindOneAndDeleteOptions.maxTime(maxTime: Long): FindOneAndDeleteOptio * @return the options */ public fun FindOneAndReplaceOptions.maxTime(maxTime: Long): FindOneAndReplaceOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * maxTime extension function * @@ -1492,7 +1491,7 @@ public fun FindOneAndReplaceOptions.maxTime(maxTime: Long): FindOneAndReplaceOpt * @return the options */ public fun FindOneAndUpdateOptions.maxTime(maxTime: Long): FindOneAndUpdateOptions = - this.apply { @Suppress("DEPRECATION") maxTime(maxTime, TimeUnit.MILLISECONDS) } + this.apply { maxTime(maxTime, TimeUnit.MILLISECONDS) } /** * expireAfter extension function * diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt index b5616a428c6..89cc8db421e 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt @@ -78,8 +78,8 @@ class AggregateIterableTest { iterable.let(bson) iterable.maxAwaitTime(1) iterable.maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") iterable.maxTime(1) - @Suppress("DEPRECATION") iterable.maxTime(1, TimeUnit.SECONDS) + iterable.maxTime(1) + iterable.maxTime(1, TimeUnit.SECONDS) iterable.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).allowDiskUse(true) @@ -93,10 +93,10 @@ class AggregateIterableTest { verify(wrapped, times(2)).explain(BsonDocument::class.java, verbosity) verify(wrapped).hint(hint) verify(wrapped).hintString(hintString) - @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) + verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) + verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).let(bson) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt index 83863849e8f..91f5e9b6f44 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/DistinctIterableTest.kt @@ -55,17 +55,17 @@ class DistinctIterableTest { iterable.comment(bsonComment) iterable.comment(comment) iterable.filter(filter) - @Suppress("DEPRECATION") iterable.maxTime(1) - @Suppress("DEPRECATION") iterable.maxTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") iterable.timeoutMode(TimeoutMode.ITERATION) + iterable.maxTime(1) + iterable.maxTime(1, TimeUnit.SECONDS) + iterable.timeoutMode(TimeoutMode.ITERATION) verify(wrapped).batchSize(batchSize) verify(wrapped).collation(collation) verify(wrapped).comment(bsonComment) verify(wrapped).comment(comment) verify(wrapped).filter(filter) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) + verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).timeoutMode(TimeoutMode.ITERATION) verifyNoMoreInteractions(wrapped) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt index 1f516d34efe..0f4b2725b2e 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/FindIterableTest.kt @@ -77,8 +77,8 @@ class FindIterableTest { iterable.max(bson) iterable.maxAwaitTime(1) iterable.maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") iterable.maxTime(1) - @Suppress("DEPRECATION") iterable.maxTime(1, TimeUnit.SECONDS) + iterable.maxTime(1) + iterable.maxTime(1, TimeUnit.SECONDS) iterable.min(bson) iterable.noCursorTimeout(true) iterable.partial(true) @@ -104,10 +104,10 @@ class FindIterableTest { verify(wrapped).let(bson) verify(wrapped).limit(1) verify(wrapped).max(bson) - @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) - @Suppress("DEPRECATION") verify(wrapped).maxTime(1, TimeUnit.SECONDS) + verify(wrapped).maxAwaitTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxAwaitTime(1, TimeUnit.SECONDS) + verify(wrapped).maxTime(1, TimeUnit.MILLISECONDS) + verify(wrapped).maxTime(1, TimeUnit.SECONDS) verify(wrapped).min(bson) verify(wrapped).noCursorTimeout(true) verify(wrapped).partial(true) diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt index 2ddbb7f2b53..e27b7852bba 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/MongoCollectionTest.kt @@ -876,7 +876,6 @@ class MongoCollectionTest { } @Test - @Suppress("DEPRECATION") fun shouldProvideExtensionFunctionsForTimeBasedOptions() { val oneThousand = 1000L diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java index f55bec16eb1..18837e44b40 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java @@ -17,7 +17,6 @@ package com.mongodb.reactivestreams.client; import com.mongodb.ExplainVerbosity; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.lang.Nullable; @@ -52,20 +51,7 @@ public interface AggregatePublisher extends Publisher { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated AggregatePublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java index efafcb1c264..8dbaeed75bb 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/DistinctPublisher.java @@ -16,7 +16,6 @@ package com.mongodb.reactivestreams.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.lang.Nullable; @@ -49,20 +48,7 @@ public interface DistinctPublisher extends Publisher { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated DistinctPublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java index 888a439774f..84501d643e9 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java @@ -18,7 +18,6 @@ import com.mongodb.CursorType; import com.mongodb.ExplainVerbosity; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.client.model.Projections; @@ -78,20 +77,7 @@ public interface FindPublisher extends Publisher { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated FindPublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/AggregatePublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/AggregatePublisherImpl.java index 26aabdbe6b2..d96c0e933da 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/AggregatePublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/AggregatePublisherImpl.java @@ -85,7 +85,6 @@ public AggregatePublisher timeoutMode(final TimeoutMode timeoutMode) { } @Override - @SuppressWarnings("deprecation") public AggregatePublisher maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/DistinctPublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/DistinctPublisherImpl.java index 4c33bf11b07..84c0df234c5 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/DistinctPublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/DistinctPublisherImpl.java @@ -58,7 +58,6 @@ public DistinctPublisher filter(@Nullable final Bson filter) { } @Override - @SuppressWarnings("deprecation") public DistinctPublisher maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/FindPublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/FindPublisherImpl.java index eeddef5449a..ff9fb3a8036 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/FindPublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/FindPublisherImpl.java @@ -70,7 +70,6 @@ public FindPublisher skip(final int skip) { } @Override - @SuppressWarnings("deprecation") public FindPublisher maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); findOptions.maxTime(maxTime, timeUnit); diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/gridfs/GridFSFindPublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/gridfs/GridFSFindPublisherImpl.java index 6f1a501a33f..41ee872c05e 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/gridfs/GridFSFindPublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/gridfs/GridFSFindPublisherImpl.java @@ -69,7 +69,6 @@ public GridFSFindPublisher filter(@Nullable final Bson filter) { } @Override - @SuppressWarnings("deprecation") public GridFSFindPublisher maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncAggregateIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncAggregateIterable.java index 2b5120063e0..6b81b1f42af 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncAggregateIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncAggregateIterable.java @@ -59,7 +59,6 @@ public AggregateIterable batchSize(final int batchSize) { } @Override - @SuppressWarnings("deprecation") public AggregateIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncDistinctIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncDistinctIterable.java index 33cac07c1ec..7f50727621d 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncDistinctIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncDistinctIterable.java @@ -41,7 +41,6 @@ public DistinctIterable filter(@Nullable final Bson filter) { } @Override - @SuppressWarnings("deprecation") public DistinctIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncFindIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncFindIterable.java index 71556eab3e7..3cf93b9ffb0 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncFindIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncFindIterable.java @@ -61,7 +61,6 @@ public FindIterable skip(final int skip) { } @Override - @SuppressWarnings("deprecation") public FindIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/AggregatePublisherImplTest.java b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/AggregatePublisherImplTest.java index 143499c841a..cfbf5a0a5b8 100644 --- a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/AggregatePublisherImplTest.java +++ b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/AggregatePublisherImplTest.java @@ -51,7 +51,6 @@ public class AggregatePublisherImplTest extends TestHelper { @DisplayName("Should build the expected AggregateOperation") @Test - @SuppressWarnings("deprecation") void shouldBuildTheExpectedOperation() { List pipeline = singletonList(BsonDocument.parse("{'$match': 1}")); @@ -146,7 +145,6 @@ void shouldBuildTheExpectedOperationForHintPlusHintString() { @DisplayName("Should build the expected AggregateOperation for $out") @Test - @SuppressWarnings("deprecation") void shouldBuildTheExpectedOperationsForDollarOut() { String collectionName = "collectionName"; List pipeline = asList(BsonDocument.parse("{'$match': 1}"), @@ -325,7 +323,6 @@ void shouldBuildTheExpectedOperationsForDollarOutAsDocument() { @DisplayName("Should build the expected AggregateOperation for $merge document") @Test - @SuppressWarnings("deprecation") void shouldBuildTheExpectedOperationsForDollarMergeDocument() { String collectionName = "collectionName"; List pipeline = asList(BsonDocument.parse("{'$match': 1}"), diff --git a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/FindPublisherImplTest.java b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/FindPublisherImplTest.java index 8217750368d..eab28373f2a 100644 --- a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/FindPublisherImplTest.java +++ b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/FindPublisherImplTest.java @@ -43,7 +43,6 @@ public class FindPublisherImplTest extends TestHelper { @DisplayName("Should build the expected FindOperation") @Test - @SuppressWarnings("deprecation") void shouldBuildTheExpectedOperation() { configureBatchCursor(); diff --git a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java index 3234771af91..97b7bbf0d78 100644 --- a/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java +++ b/driver-reactive-streams/src/test/unit/com/mongodb/reactivestreams/client/internal/MongoCollectionImplTest.java @@ -569,7 +569,6 @@ public void testDropIndexes() { @Test - @SuppressWarnings("deprecation") public void testEstimatedDocumentCount() { EstimatedDocumentCountOptions options = new EstimatedDocumentCountOptions().maxTime(1, TimeUnit.MILLISECONDS); assertAll("estimatedDocumentCount", diff --git a/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala index f2fedd553dd..9f8a24182db 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala @@ -54,20 +54,9 @@ case class AggregateObservable[TResult](private val wrapped: AggregatePublisher[ * Sets the maximum execution time on the server for this operation. * * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSession]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def maxTime(duration: Duration): AggregateObservable[TResult] = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this diff --git a/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala index cc40841737a..1a8c6307e22 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/DistinctObservable.scala @@ -37,20 +37,9 @@ case class DistinctObservable[TResult](private val wrapped: DistinctPublisher[TR * Sets the query filter to apply to the query. * * [[https://www.mongodb.com/docs/manual/reference/method/db.collection.find/ Filter]] - * * @param filter the filter, which may be null. * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSession]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def filter(filter: Bson): DistinctObservable[TResult] = { wrapped.filter(filter) this diff --git a/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala index 4fcfb40f38b..b584a064162 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/FindObservable.scala @@ -85,20 +85,9 @@ case class FindObservable[TResult](private val wrapped: FindPublisher[TResult]) * Sets the maximum execution time on the server for this operation. * * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSession]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def maxTime(duration: Duration): FindObservable[TResult] = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this diff --git a/driver-sync/src/main/com/mongodb/client/AggregateIterable.java b/driver-sync/src/main/com/mongodb/client/AggregateIterable.java index cf8a3be2474..dda8f757119 100644 --- a/driver-sync/src/main/com/mongodb/client/AggregateIterable.java +++ b/driver-sync/src/main/com/mongodb/client/AggregateIterable.java @@ -17,7 +17,6 @@ package com.mongodb.client; import com.mongodb.ExplainVerbosity; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.lang.Nullable; @@ -95,20 +94,7 @@ public interface AggregateIterable extends MongoIterable { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated AggregateIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/DistinctIterable.java b/driver-sync/src/main/com/mongodb/client/DistinctIterable.java index 07ec37e8ee2..ba1f3217890 100644 --- a/driver-sync/src/main/com/mongodb/client/DistinctIterable.java +++ b/driver-sync/src/main/com/mongodb/client/DistinctIterable.java @@ -16,7 +16,6 @@ package com.mongodb.client; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.lang.Nullable; @@ -48,20 +47,7 @@ public interface DistinctIterable extends MongoIterable { * @param maxTime the max time * @param timeUnit the time unit, which may not be null * @return this - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated DistinctIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/FindIterable.java b/driver-sync/src/main/com/mongodb/client/FindIterable.java index ecc03e33605..b93ce1873ac 100644 --- a/driver-sync/src/main/com/mongodb/client/FindIterable.java +++ b/driver-sync/src/main/com/mongodb/client/FindIterable.java @@ -18,7 +18,6 @@ import com.mongodb.CursorType; import com.mongodb.ExplainVerbosity; -import com.mongodb.MongoClientSettings; import com.mongodb.client.cursor.TimeoutMode; import com.mongodb.client.model.Collation; import com.mongodb.client.model.Projections; @@ -70,20 +69,7 @@ public interface FindIterable extends MongoIterable { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated FindIterable maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterableImpl.java b/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterableImpl.java index 95737b70e35..80bfb498e12 100644 --- a/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterableImpl.java @@ -61,7 +61,6 @@ public GridFSFindIterable filter(@Nullable final Bson filter) { } @Override - @SuppressWarnings("deprecation") public GridFSFindIterable maxTime(final long maxTime, final TimeUnit timeUnit) { underlying.maxTime(maxTime, timeUnit); return this; diff --git a/driver-sync/src/main/com/mongodb/client/internal/AggregateIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/AggregateIterableImpl.java index 4feb06fa9b9..23c8fb35283 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/AggregateIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/AggregateIterableImpl.java @@ -123,7 +123,6 @@ public AggregateIterable timeoutMode(final TimeoutMode timeoutMode) { } @Override - @Deprecated public AggregateIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-sync/src/main/com/mongodb/client/internal/DistinctIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/DistinctIterableImpl.java index bf7dd5c8a49..b37931c52cb 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/DistinctIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/DistinctIterableImpl.java @@ -66,7 +66,6 @@ public DistinctIterable filter(@Nullable final Bson filter) { } @Override - @SuppressWarnings("deprecation") public DistinctIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); this.maxTimeMS = TimeUnit.MILLISECONDS.convert(maxTime, timeUnit); diff --git a/driver-sync/src/main/com/mongodb/client/internal/FindIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/FindIterableImpl.java index df8b17866ac..fbead0d7911 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/FindIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/FindIterableImpl.java @@ -81,7 +81,6 @@ public FindIterable skip(final int skip) { } @Override - @SuppressWarnings("deprecation") public FindIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); findOptions.maxTime(maxTime, timeUnit); diff --git a/driver-sync/src/main/com/mongodb/client/internal/MongoCollectionImpl.java b/driver-sync/src/main/com/mongodb/client/internal/MongoCollectionImpl.java index 0a95bf4d513..8466950d7e5 100755 --- a/driver-sync/src/main/com/mongodb/client/internal/MongoCollectionImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/MongoCollectionImpl.java @@ -123,8 +123,7 @@ class MongoCollectionImpl implements MongoCollection { this.uuidRepresentation = notNull("uuidRepresentation", uuidRepresentation); this.autoEncryptionSettings = autoEncryptionSettings; this.timeoutSettings = timeoutSettings; - this.operations = new SyncOperations<>(namespace, - documentClass, readPreference, codecRegistry, readConcern, writeConcern, + this.operations = new SyncOperations<>(namespace, documentClass, readPreference, codecRegistry, readConcern, writeConcern, retryWrites, retryReads, timeoutSettings); } diff --git a/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java b/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java index 924b96b7151..e49fcd66725 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java @@ -313,7 +313,6 @@ BsonDocument getRunCommandResult(final BsonDocument collectionOptions, final Bso return toResult(response); } - @SuppressWarnings("deprecation") //maxTimeMS BsonDocument getAggregateResult(final BsonDocument collectionOptions, final BsonDocument arguments, @Nullable final ClientSession clientSession) { List pipeline = new ArrayList<>(); @@ -551,7 +550,6 @@ BsonDocument getFindResult(final BsonDocument collectionOptions, final BsonDocum return toResult(createFindIterable(collectionOptions, arguments, clientSession)); } - @SuppressWarnings("deprecation") //maxTimeMS private FindIterable createFindIterable(final BsonDocument collectionOptions, final BsonDocument arguments, @Nullable final ClientSession clientSession) { FindIterable iterable; diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java b/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java index 88c416ea5c6..43c3e4b2637 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java @@ -713,7 +713,6 @@ private void initClientEncryption(final BsonDocument entity, final String id, putEntity(id, clientEncryptionSupplier.apply(Assertions.notNull("mongoClient", mongoClient), builder.build()), clientEncryptions); } - @SuppressWarnings("deprecation") //maxCommitTimeMS private TransactionOptions getTransactionOptions(final BsonDocument options) { TransactionOptions.Builder transactionOptionsBuilder = TransactionOptions.builder(); for (Map.Entry entry : options.entrySet()) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java index af1ef3d61b8..f1c26048154 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java @@ -395,7 +395,6 @@ OperationResult createFindCursor(final BsonDocument operation) { } @NonNull - @SuppressWarnings("deprecation") //maxTimeMS private FindIterable createFindIterable(final BsonDocument operation) { MongoCollection collection = getMongoCollection(operation); BsonDocument arguments = operation.getDocument("arguments", new BsonDocument()); @@ -742,7 +741,6 @@ OperationResult executeFindOneAndDelete(final BsonDocument operation) { }); } - @SuppressWarnings("deprecation") //maxTimeMS OperationResult executeAggregate(final BsonDocument operation) { String entityName = operation.getString("object").getValue(); BsonDocument arguments = operation.getDocument("arguments", new BsonDocument()); @@ -1864,7 +1862,6 @@ public OperationResult executeCountDocuments(final BsonDocument operation) { }); } - @SuppressWarnings("deprecation") //maxTimeMS public OperationResult executeEstimatedDocumentCount(final BsonDocument operation) { MongoCollection collection = getMongoCollection(operation); BsonDocument arguments = operation.getDocument("arguments", new BsonDocument()); From 2ad65b25c75e5d5c5da5a3b1d9a462bfb5c5f386 Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 17 Apr 2024 15:54:45 -0700 Subject: [PATCH 4/5] Revert "Kotlin and Scala ListCollectionNames maxtime deprecations" This reverts commit 1d386ecf0fa39a3f48ffd162b8c9280ff70339f7. --- .../client/coroutine/ListCollectionNamesFlow.kt | 12 ------------ .../kotlin/client/ListCollectionNamesIterable.kt | 12 ------------ .../scala/ListCollectionNamesObservable.scala | 11 ----------- 3 files changed, 35 deletions(-) diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionNamesFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionNamesFlow.kt index c55516b6369..2dc64e870a7 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionNamesFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ListCollectionNamesFlow.kt @@ -34,23 +34,11 @@ public class ListCollectionNamesFlow(private val wrapped: ListCollectionNamesPub /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListCollectionNamesFlow = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterable.kt index a990cbd634e..33053dfc876 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterable.kt @@ -31,23 +31,11 @@ public class ListCollectionNamesIterable(private val wrapped: JListCollectionNam /** * Sets the maximum execution time on the server for this operation. * - * **NOTE**: The maximum execution time option is deprecated. Prefer using the operation execution timeout - * configuration options available at the following levels: - * - [com.mongodb.MongoClientSettings.Builder.timeout] - * - [MongoDatabase.withTimeout] - * - [MongoCollection.withTimeout] - * - [ClientSession] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. - * * @param maxTime the max time * @param timeUnit the time unit, defaults to Milliseconds * @return this * @see [Max Time](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) */ - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") public fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListCollectionNamesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala index 0ced9f238bb..50b970eec62 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/ListCollectionNamesObservable.scala @@ -47,20 +47,9 @@ case class ListCollectionNamesObservable(wrapped: ListCollectionNamesPublisher) * Sets the maximum execution time on the server for this operation. * * [[https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/ Max Time]] - * * @param duration the duration * @return this - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - * - [[org.mongodb.scala.MongoClientSettings.Builder timeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoDatabase.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.MongoCollection.withTimeout withTimeout(long, TimeUnit)]] - * - [[org.mongodb.scala.ClientSession]] - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum - * execution time irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @deprecated def maxTime(duration: Duration): ListCollectionNamesObservable = { wrapped.maxTime(duration.toMillis, TimeUnit.MILLISECONDS) this From 3cfeaad67156acfe3a4f3ad0f516a239347a3f8b Mon Sep 17 00:00:00 2001 From: "slav.babanin" Date: Wed, 17 Apr 2024 16:02:11 -0700 Subject: [PATCH 5/5] Revert deprecation warnings. JAVA-5403 --- .../com/mongodb/internal/TimeoutSettings.java | 24 ++++++++++++++++++- .../SyncListCollectionNamesIterable.kt | 2 -- .../SyncListCollectionNamesIterable.kt | 2 -- .../client/ListCollectionNamesIterableTest.kt | 1 - .../client/ListCollectionNamesPublisher.java | 14 ----------- .../ListCollectionNamesPublisherImpl.java | 1 - .../SyncListCollectionNamesIterable.java | 1 - .../ListCollectionNamesIterableImpl.java | 1 - 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java b/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java index 05b5b9be09b..486a893d74c 100644 --- a/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java +++ b/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicLong; import static com.mongodb.assertions.Assertions.isTrueArgument; +import static java.util.concurrent.TimeUnit.MILLISECONDS; /** * Timeout Settings. @@ -51,6 +52,23 @@ public class TimeoutSettings { public static final TimeoutSettings DEFAULT = create(MongoClientSettings.builder().build()); + @Nullable + public static Long convertAndValidateTimeoutNullable(@Nullable final Long timeout, final TimeUnit timeUnit) { + return timeout == null ? null : convertAndValidateTimeout(timeout, timeUnit, "timeout"); + } + + public static long convertAndValidateTimeout(final long timeout, final TimeUnit timeUnit) { + return convertAndValidateTimeout(timeout, timeUnit, "timeout"); + } + + public static long convertAndValidateTimeout(final long timeout, final TimeUnit timeUnit, final String fieldName) { + return isTrueArgument(fieldName + " was too small. After conversion it was rounded to 0 milliseconds, " + + " which would result in an unintended infinite timeout.", + () -> MILLISECONDS.convert(timeout, timeUnit), + (timeoutMS) -> timeout == 0 && timeoutMS == 0 || timeoutMS > 0); + } + + @SuppressWarnings("deprecation") public static TimeoutSettings create(final MongoClientSettings settings) { return new TimeoutSettings( settings.getClusterSettings().getServerSelectionTimeout(TimeUnit.MILLISECONDS), @@ -108,7 +126,11 @@ public TimeoutSettings connectionOnly() { return new TimeoutSettings(serverSelectionTimeoutMS, connectTimeoutMS, readTimeoutMS, null, maxWaitTimeMS); } - public TimeoutSettings withTimeoutMS(@Nullable final Long timeoutMS) { + public TimeoutSettings withTimeout(@Nullable final Long timeout, final TimeUnit timeUnit) { + return withTimeoutMS(convertAndValidateTimeoutNullable(timeout, timeUnit)); + } + + TimeoutSettings withTimeoutMS(@Nullable final Long timeoutMS) { return new TimeoutSettings(timeoutMS, serverSelectionTimeoutMS, connectTimeoutMS, readTimeoutMS, maxAwaitTimeMS, maxTimeMS, maxCommitTimeMS, wTimeoutMS, maxWaitTimeMS); } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt index f110a744047..63a7af3f526 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt +++ b/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt @@ -26,8 +26,6 @@ data class SyncListCollectionNamesIterable(val wrapped: ListCollectionNamesFlow) override fun batchSize(batchSize: Int): SyncListCollectionNamesIterable = apply { wrapped.batchSize(batchSize) } - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListCollectionNamesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt index 7477c9c9de1..45f910664a7 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt +++ b/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt @@ -26,8 +26,6 @@ internal class SyncListCollectionNamesIterable(val wrapped: ListCollectionNamesI override fun batchSize(batchSize: Int): SyncListCollectionNamesIterable = apply { wrapped.batchSize(batchSize) } - @Deprecated("Prefer using the operation execution timeout configuration option", level = DeprecationLevel.WARNING) - @Suppress("DEPRECATION") override fun maxTime(maxTime: Long, timeUnit: TimeUnit): SyncListCollectionNamesIterable = apply { wrapped.maxTime(maxTime, timeUnit) } diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterableTest.kt index dcfbb9d3ff0..c5466a62e60 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/ListCollectionNamesIterableTest.kt @@ -38,7 +38,6 @@ class ListCollectionNamesIterableTest { } @Test - @Suppress("DEPRECATION") fun shouldCallTheUnderlyingMethods() { val wrapped: JListCollectionNamesIterable = mock() val iterable = ListCollectionNamesIterable(wrapped) diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java index e4fa49cfede..a28fcff1030 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ListCollectionNamesPublisher.java @@ -16,7 +16,6 @@ package com.mongodb.reactivestreams.client; -import com.mongodb.MongoClientSettings; import com.mongodb.lang.Nullable; import org.bson.BsonValue; import org.bson.conversions.Bson; @@ -47,20 +46,7 @@ public interface ListCollectionNamesPublisher extends Publisher { * @param timeUnit the time unit, which may not be null * @return this * @mongodb.driver.manual reference/operator/meta/maxTimeMS/ Max Time - * - * @deprecated Prefer using the operation execution timeout configuration options available at the following levels: - * - *
      - *
    • {@link MongoClientSettings.Builder#timeout(long, TimeUnit)}
    • - *
    • {@link MongoDatabase#withTimeout(long, TimeUnit)}
    • - *
    • {@link MongoCollection#withTimeout(long, TimeUnit)}
    • - *
    • {@link ClientSession}
    • - *
    - * - * When executing an operation, any explicitly set timeout at these levels takes precedence, rendering this maximum execution time - * irrelevant. If no timeout is specified at these levels, the maximum execution time will be used. */ - @Deprecated ListCollectionNamesPublisher maxTime(long maxTime, TimeUnit timeUnit); /** diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionNamesPublisherImpl.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionNamesPublisherImpl.java index 08a5c580d7e..f07379d568c 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionNamesPublisherImpl.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/ListCollectionNamesPublisherImpl.java @@ -42,7 +42,6 @@ public final class ListCollectionNamesPublisherImpl implements ListCollectionNam } @Override - @Deprecated public ListCollectionNamesPublisher maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); wrapped.maxTime(maxTime, timeUnit); diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionNamesIterable.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionNamesIterable.java index d96deaff0d0..7a4d9481c03 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionNamesIterable.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/SyncListCollectionNamesIterable.java @@ -39,7 +39,6 @@ public ListCollectionNamesIterable filter(@Nullable final Bson filter) { } @Override - @Deprecated public ListCollectionNamesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { wrapped.maxTime(maxTime, timeUnit); return this; diff --git a/driver-sync/src/main/com/mongodb/client/internal/ListCollectionNamesIterableImpl.java b/driver-sync/src/main/com/mongodb/client/internal/ListCollectionNamesIterableImpl.java index 13f9935975c..aabdcd8e7a7 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/ListCollectionNamesIterableImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/ListCollectionNamesIterableImpl.java @@ -48,7 +48,6 @@ public ListCollectionNamesIterable filter(@Nullable final Bson filter) { } @Override - @Deprecated public ListCollectionNamesIterable maxTime(final long maxTime, final TimeUnit timeUnit) { notNull("timeUnit", timeUnit); wrapped.maxTime(maxTime, timeUnit);