Skip to content

Commit ed1fadb

Browse files
authored
Clean up internal packages (#1026)
* Ensure that every public type has Javadoc indicating it's not part of the public API * Remove boilerplate Javadoc * Remove some unused methods
1 parent a999e15 commit ed1fadb

File tree

230 files changed

+426
-3321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+426
-3321
lines changed

bson/src/main/org/bson/internal/ProvidersCodecRegistry.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
import static org.bson.assertions.Assertions.isTrueArgument;
3232
import static org.bson.assertions.Assertions.notNull;
3333

34+
/**
35+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
36+
*/
3437
public final class ProvidersCodecRegistry implements CycleDetectingCodecRegistry {
3538
private final List<CodecProvider> codecProviders;
3639
private final CodecCache codecCache = new CodecCache();

bson/src/main/org/bson/internal/UuidHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
/**
2828
* Utilities for encoding and decoding UUID into binary.
29+
*
30+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2931
*/
3032
public final class UuidHelper {
3133
private static void writeLongToArrayBigEndian(final byte[] bytes, final int offset, final long x) {

driver-core/src/main/com/mongodb/internal/CheckedSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package com.mongodb.internal;
1818

1919
/**
20-
* This class is not part of the public API and may be removed or changed at any time.
20+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2121
*/
2222
@FunctionalInterface
2323
public interface CheckedSupplier<T, E extends Exception> {

driver-core/src/main/com/mongodb/internal/HexUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.security.NoSuchAlgorithmException;
2222

2323
/**
24-
* This class is not part of the public API and may be removed or changed at any time.
24+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2525
*/
2626
public final class HexUtils {
2727
/**

driver-core/src/main/com/mongodb/internal/IgnorableRequestContext.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
/**
2525
* A {@link RequestContext} that can be ignored by the driver. Useful to ensure that we always
2626
* have a non-null {@link RequestContext} to pass around the driver.
27+
*
28+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2729
*/
2830
public final class IgnorableRequestContext implements RequestContext {
2931

driver-core/src/main/com/mongodb/internal/Iterables.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
import static java.util.Arrays.asList;
2828
import static java.util.Collections.singleton;
2929

30+
/**
31+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
32+
*/
3033
public final class Iterables {
3134
@SafeVarargs
3235
@SuppressWarnings("varargs")

driver-core/src/main/com/mongodb/internal/Locks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import java.util.function.Supplier;
2323

2424
/**
25-
* This class is not part of the public API and may be removed or changed at any time.
25+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2626
*/
2727
public final class Locks {
2828
public static void withLock(final Lock lock, final Runnable action) {

driver-core/src/main/com/mongodb/internal/Timeout.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
/**
3131
* A <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html">value-based</a> class
3232
* useful for tracking timeouts.
33+
*
34+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
3335
*/
3436
@Immutable
3537
public final class Timeout {

driver-core/src/main/com/mongodb/internal/VisibleForTesting.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* Denotes that the annotated program element is made more accessible than otherwise necessary for the purpose of testing.
2626
* The annotated program element must be used as if it had the {@linkplain #otherwise() intended} access modifier
2727
* for any purpose other than testing.
28+
*
29+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2830
*/
2931
@Documented
3032
@Retention(RetentionPolicy.SOURCE)

driver-core/src/main/com/mongodb/internal/async/AsyncAggregateResponseBatchCursor.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,14 @@
2222
/**
2323
* Extends the async batch cursor interface to include information included in an aggregate or getMore response.
2424
*
25-
* @param <T> The type of documents the cursor contains
26-
* @mongodb.driver.manual ../meta-driver/latest/legacy/mongodb-wire-protocol/#wire-op-get-more OP_GET_MORE
25+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2726
*/
2827
public interface AsyncAggregateResponseBatchCursor<T> extends AsyncBatchCursor<T> {
29-
/**
30-
* Returns the postBatchResumeToken.
31-
*
32-
* @return the postBatchResumeToken
33-
*/
3428
BsonDocument getPostBatchResumeToken();
3529

36-
/**
37-
* Returns the operation time found in the aggregate or getMore response.
38-
*
39-
* @return the operation time
40-
*/
4130
BsonTimestamp getOperationTime();
4231

43-
/**
44-
* Returns true if the first batch was empty.
45-
*
46-
* @return true if the first batch was empty
47-
*/
4832
boolean isFirstBatchEmpty();
4933

50-
/**
51-
* Returns the max wire version.
52-
*
53-
* @return the max wire version
54-
*/
5534
int getMaxWireVersion();
5635
}

driver-core/src/main/com/mongodb/internal/async/AsyncBatchCursor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* the {@code next} method will return the first batch, and subsequent calls will trigger an asynchronous request to get the next batch
2525
* of results. Clients can control the batch size by setting the {@code batchSize} property between calls to {@code next}.
2626
*
27-
* @param <T> The type of documents the cursor contains
28-
* @mongodb.driver.manual ../meta-driver/latest/legacy/mongodb-wire-protocol/#wire-op-get-more OP_GET_MORE
27+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2928
*/
3029
public interface AsyncBatchCursor<T> extends Closeable {
3130
/**

driver-core/src/main/com/mongodb/internal/async/ErrorHandlingResultCallback.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
import static com.mongodb.assertions.Assertions.notNull;
2222

2323
/**
24-
* This class is not part of the public API and may be removed or changed at any time.
25-
*
26-
* @param <T> the result type
24+
* <p>This class is not part of the public API and may be removed or changed at any time.</p>
2725
*/
2826
public class ErrorHandlingResultCallback<T> implements SingleResultCallback<T> {
2927
private final SingleResultCallback<T> wrapped;

driver-core/src/main/com/mongodb/internal/async/SingleResultCallback.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
/**
2222
* An interface to describe the completion of an asynchronous function, which may be represented as {@link AsyncCallbackFunction}.
2323
*
24-
* @param <T> The type of a successful result. A failed result is of the {@link Throwable} type.
25-
* @see AsyncCallbackFunction
24+
*<p>This class is not part of the public API and may be removed or changed at any time</p>
2625
*/
2726
public interface SingleResultCallback<T> {
2827
/**

driver-core/src/main/com/mongodb/internal/async/function/AsyncCallbackBiFunction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* An {@linkplain AsyncCallbackFunction asynchronous callback-based function} of two parameters.
2525
* This class is a callback-based counterpart of {@link BiFunction}.
2626
*
27+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
28+
*
2729
* @param <P1> The type of the first parameter to the function.
2830
* @param <P2> The type of the second parameter to the function.
2931
* @param <R> See {@link AsyncCallbackFunction}

driver-core/src/main/com/mongodb/internal/async/function/AsyncCallbackFunction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
* are used as they defined by the Java Language Specification, while the terms "successful" and "failed completion" are used to refer to a
3737
* situation when the function produces either a successful or a failed result respectively.
3838
*
39+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
40+
*
3941
* @param <P> The type of the first parameter to the function.
4042
* @param <R> The type of successful result. A failed result is of the {@link Throwable} type
4143
* as defined by {@link SingleResultCallback#onResult(Object, Throwable)}.

driver-core/src/main/com/mongodb/internal/async/function/AsyncCallbackLoop.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* <li>the original function calls {@link LoopState#breakAndCompleteIf(Supplier, SingleResultCallback)}.</li>
3636
* </ul>
3737
*
38+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
3839
*/
3940
@NotThreadSafe
4041
public final class AsyncCallbackLoop implements AsyncCallbackRunnable {

driver-core/src/main/com/mongodb/internal/async/function/AsyncCallbackRunnable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* An {@linkplain AsyncCallbackFunction asynchronous callback-based function} of no parameters and no successful result.
2222
* This class is a callback-based counterpart of {@link Runnable}.
2323
*
24+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
25+
*
2426
* @see AsyncCallbackFunction
2527
*/
2628
@FunctionalInterface

driver-core/src/main/com/mongodb/internal/async/function/AsyncCallbackSupplier.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
* Any asynchronous callback function with parameters may be represented this way by partially applying the function to its parameters
2727
* until no parameters are left unapplied, and only a callback is left to be consumed.
2828
*
29+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
30+
*
2931
* @param <R> See {@link AsyncCallbackFunction}.
3032
* @see AsyncCallbackFunction
3133
*/

driver-core/src/main/com/mongodb/internal/async/function/LoopState.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
* {@linkplain #attachment(AttachmentKey) Attachments} may be used by the associated loop
3535
* to preserve a state between iterations.
3636
*
37+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
38+
*
3739
* @see AsyncCallbackLoop
3840
*/
3941
@NotThreadSafe

driver-core/src/main/com/mongodb/internal/async/function/RetryState.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
* {@linkplain #attachment(AttachmentKey) Attachments} may be used by the associated retryable activity either
3737
* to preserve a state between attempts.
3838
*
39+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
40+
*
3941
* @see RetryingSyncSupplier
4042
* @see RetryingAsyncCallbackSupplier
4143
*/

driver-core/src/main/com/mongodb/internal/async/function/RetryingAsyncCallbackSupplier.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* For example, the {@link RetryState#breakAndCompleteIfRetryAnd(Supplier, SingleResultCallback)} method may be used to
3434
* break retrying if the original function decides so.
3535
*
36+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
37+
*
3638
* @see RetryingSyncSupplier
3739
*/
3840
@NotThreadSafe

driver-core/src/main/com/mongodb/internal/async/function/RetryingSyncSupplier.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
* For example, the {@link RetryState#breakAndThrowIfRetryAnd(Supplier)} method may be used to
3030
* break retrying if the original function decides so.
3131
*
32+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
33+
*
3234
* @see RetryingAsyncCallbackSupplier
3335
*/
3436
@NotThreadSafe

driver-core/src/main/com/mongodb/internal/authentication/AwsCredentialHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* Utility class for working with AWS authentication.
3030
*
31-
* <p>This class should not be considered a part of the public API.</p>
31+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
3232
*/
3333
public final class AwsCredentialHelper {
3434
public static final Logger LOGGER = Loggers.getLogger("authenticator");

driver-core/src/main/com/mongodb/internal/authentication/AwsSdkV1CredentialSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import java.util.function.Supplier;
2626

27-
public final class AwsSdkV1CredentialSupplier implements Supplier<AwsCredential> {
27+
final class AwsSdkV1CredentialSupplier implements Supplier<AwsCredential> {
2828

2929
private final AWSCredentialsProvider provider = DefaultAWSCredentialsProviderChain.getInstance();
3030

driver-core/src/main/com/mongodb/internal/authentication/AwsSdkV2CredentialSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import java.util.function.Supplier;
2626

27-
public final class AwsSdkV2CredentialSupplier implements Supplier<AwsCredential> {
27+
final class AwsSdkV2CredentialSupplier implements Supplier<AwsCredential> {
2828

2929
private final AwsCredentialsProvider provider = DefaultCredentialsProvider.create();
3030

driver-core/src/main/com/mongodb/internal/authentication/BuiltInAwsCredentialSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import static com.mongodb.internal.authentication.HttpHelper.getHttpContents;
2727

28-
public class BuiltInAwsCredentialSupplier implements Supplier<AwsCredential> {
28+
class BuiltInAwsCredentialSupplier implements Supplier<AwsCredential> {
2929

3030
@Override
3131
public AwsCredential get() {

driver-core/src/main/com/mongodb/internal/authentication/GcpCredentialHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/**
2828
* Utility class for working with GCP authentication.
2929
*
30-
* <p>This class should not be considered a part of the public API.</p>
30+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
3131
*/
3232
public final class GcpCredentialHelper {
3333
public static BsonDocument obtainFromEnvironment() {

driver-core/src/main/com/mongodb/internal/authentication/HttpHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929

3030
/**
3131
* Utility class for working with HTTP servers.
32-
*
33-
* <p>This class should not be considered a part of the public API.</p>
3432
*/
35-
public final class HttpHelper {
33+
final class HttpHelper {
3634

3735
private HttpHelper() {
3836
}

driver-core/src/main/com/mongodb/internal/authentication/NativeAuthenticationHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* Utility class for working with MongoDB native authentication.
3131
*
32-
* <p>This class should not be considered a part of the public API.</p>
32+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
3333
*/
3434
public final class NativeAuthenticationHelper {
3535

driver-core/src/main/com/mongodb/internal/authentication/SaslPrep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* Utility class for Sasl string preparation.
2525
*
26-
* <p>This class should not be considered a part of the public API.</p>
26+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2727
*/
2828
public final class SaslPrep {
2929

driver-core/src/main/com/mongodb/internal/binding/AbstractReferenceCounted.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
import java.util.concurrent.atomic.AtomicInteger;
2020

21+
/**
22+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
23+
*/
2124
public abstract class AbstractReferenceCounted implements ReferenceCounted {
2225
private final AtomicInteger referenceCount = new AtomicInteger(1);
2326
@Override

driver-core/src/main/com/mongodb/internal/binding/AsyncClusterAwareReadWriteBinding.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.mongodb.internal.connection.Cluster;
2222

2323
/**
24-
* This interface is not part of the public API and may be removed or changed at any time.
24+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2525
*/
2626
public interface AsyncClusterAwareReadWriteBinding extends AsyncReadWriteBinding {
2727
Cluster getCluster();

driver-core/src/main/com/mongodb/internal/binding/AsyncClusterBinding.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* A simple ReadWriteBinding implementation that supplies write connection sources bound to a possibly different primary each time, and a
4444
* read connection source bound to a possible different server each time.
4545
*
46-
* @since 3.0
46+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
4747
*/
4848
public class AsyncClusterBinding extends AbstractReferenceCounted implements AsyncClusterAwareReadWriteBinding {
4949
private final Cluster cluster;
@@ -61,7 +61,7 @@ public class AsyncClusterBinding extends AbstractReferenceCounted implements Asy
6161
* @param readConcern a non-null read concern
6262
* @param serverApi a server API, which may be null
6363
* @param requestContext the request context
64-
* @since 3.8
64+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
6565
*/
6666
public AsyncClusterBinding(final Cluster cluster, final ReadPreference readPreference, final ReadConcern readConcern,
6767
@Nullable final ServerApi serverApi, final RequestContext requestContext) {

driver-core/src/main/com/mongodb/internal/binding/AsyncConnectionSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* A source of connections to a single MongoDB server.
3030
*
31-
* @since 3.0
31+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
3232
*/
3333
public interface AsyncConnectionSource extends ReferenceCounted {
3434

@@ -44,7 +44,7 @@ public interface AsyncConnectionSource extends ReferenceCounted {
4444
*
4545
* @return the session context, which may not be null
4646
*
47-
* @since 3.6
47+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
4848
*/
4949
SessionContext getSessionContext();
5050

driver-core/src/main/com/mongodb/internal/binding/AsyncReadBinding.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* An asynchronous factory of connection sources to servers that can be read from and that satisfy the specified read preference.
2828
*
29-
* @since 3.0
29+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
3030
*/
3131
public interface AsyncReadBinding extends ReferenceCounted {
3232
/**
@@ -40,7 +40,6 @@ public interface AsyncReadBinding extends ReferenceCounted {
4040
*
4141
* @return the session context, which may not be null
4242
*
43-
* @since 3.6
4443
*/
4544
SessionContext getSessionContext();
4645

driver-core/src/main/com/mongodb/internal/binding/AsyncReadWriteBinding.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* An asynchronous factory of connection sources to servers that can be read from or written to.
2222
*
23-
* @since 3.0
23+
* <p>This class is not part of the public API and may be removed or changed at any time</p>
2424
*/
2525
public interface AsyncReadWriteBinding extends AsyncReadBinding, AsyncWriteBinding, ReferenceCounted {
2626
@Override

0 commit comments

Comments
 (0)