Skip to content

Update specifications links in source comments #1662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bson/src/main/org/bson/json/JsonMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public enum JsonMode {
* Standard extended JSON representation.
*
* @since 3.5
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json.rst">Extended JSON Specification</a>
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md">Extended JSON Specification</a>
*/
EXTENDED,

/**
* Standard relaxed extended JSON representation.
*
* @since 3.5
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json.rst">Extended JSON Specification</a>
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md">Extended JSON Specification</a>
*/
RELAXED
}
11 changes: 5 additions & 6 deletions bson/src/main/org/bson/types/Decimal128.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;

import static java.math.MathContext.DECIMAL128;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import java.util.HashSet;
import java.util.Set;
Comment on lines +24 to +25
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why the import order changed here (vscode auto-adjusted them I guess).

Feel free to put these back if it's an issue


/**
* A binary integer decimal representation of a 128-bit decimal value, supporting 34 decimal digits of significand and an exponent range
* of -6143 to +6144.
*
* @since 3.4
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst">BSON Decimal128
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.md">BSON Decimal128
* specification</a>
* @see <a href="https://en.wikipedia.org/wiki/Binary_Integer_Decimal">binary integer decimal</a>
* @see <a href="https://en.wikipedia.org/wiki/Decimal128_floating-point_format">decimal128 floating-point format</a>
Expand Down Expand Up @@ -110,7 +109,7 @@ public final class Decimal128 extends Number implements Comparable<Decimal128> {
* @return the Decimal128 value representing the given String
* @throws NumberFormatException if the value is out of the Decimal128 range
* @see
* <a href="https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst#from-string-representation">
* <a href="https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.md#from-string-representation">
* From-String Specification</a>
*/
public static Decimal128 parse(final String value) {
Expand Down Expand Up @@ -565,7 +564,7 @@ public int hashCode() {
* Returns the String representation of the Decimal128 value.
*
* @return the String representation
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst#to-string-representation">
* @see <a href="https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.md#to-string-representation">
* To-String Sprecification</a>
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void selectServerAsync(ServerSelector serverSelector, OperationContext operation

/**
* This method allows {@link Server}s to notify the {@link Cluster} about changes in their state as per the
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst">
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md">
* Server Discovery And Monitoring</a> specification.
*/
void onChange(ServerDescriptionChangedEvent event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ final class DefaultConnectionPool implements ConnectionPool {

/**
* @param sdamProvider For handling exceptions via the
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst">
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md">
* SDAM</a> machinery as specified
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst#populating-the-pool-with-a-connection-internal-implementation">
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#populating-the-pool-with-a-connection-internal-implementation">
* here</a>.
* Must provide an {@linkplain Optional#isPresent() empty} {@link Optional} if created in load-balanced mode,
* otherwise must provide a non-empty {@link Optional}.
Expand Down Expand Up @@ -511,7 +511,7 @@ private void connectionPoolCreated(final ConnectionPoolListener connectionPoolLi
* @return A {@link StartTime} before executing {@link ConnectionPoolListener#connectionCreated(ConnectionCreatedEvent)}
* and logging the event. This order is required by

* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst#events">CMAP</a>
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#events">CMAP</a>
* and {@link ConnectionReadyEvent#getElapsedTime(TimeUnit)}.
*/
private StartTime connectionCreated(final ConnectionPoolListener connectionPoolListener, final ConnectionId connectionId) {
Expand Down Expand Up @@ -570,7 +570,7 @@ private void connectionCheckedOut(
* @return A {@link StartTime} before executing
* {@link ConnectionPoolListener#connectionCheckOutStarted(ConnectionCheckOutStartedEvent)} and logging the event.
* This order is required by
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst#events">CMAP</a>
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#events">CMAP</a>
* and {@link ConnectionCheckedOutEvent#getElapsedTime(TimeUnit)}, {@link ConnectionCheckOutFailedEvent#getElapsedTime(TimeUnit)}.
*/
private StartTime connectionCheckoutStarted(final OperationContext operationContext) {
Expand Down Expand Up @@ -1425,7 +1425,7 @@ Timeout timeout() {
* {@link #runOnceAndStop()} unless {@link BackgroundMaintenanceManager} is {@linkplain #close() closed}.
* <p>
* This class implements
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst#background-thread">
* <a href="https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#background-thread">
* CMAP background thread</a>.
*/
@NotThreadSafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

/**
* See the
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst">
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md">
* Server Discovery And Monitoring</a> specification.
*/
@ThreadSafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public interface Server {

/**
* An approximation of the
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#operationcount">
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.md#operationcount">
* number of operations that this server is currently executing</a>.
*
* @return A negative value iff the server does not track its operation count.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
* See <a href="https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.rst#test-plan">spec</a>
* See <a href="https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.md#test-plan">spec</a>
*
* <p>
* NOTE: This class also contains tests that aren't categorized as Prose tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import static com.mongodb.ClusterFixture.serverVersionLessThan
import static com.mongodb.internal.connection.ServerHelper.waitForLastRelease
import static java.util.Arrays.asList

// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.rst#prose-tests
// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.md#prose-tests
@IgnoreIf({ !(serverVersionAtLeast(3, 6) && !isStandalone()) })
class ChangeStreamOperationProseTestSpecification extends OperationFunctionalSpecification {

Expand Down
10 changes: 5 additions & 5 deletions driver-core/src/test/resources/client-side-encryption/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ and MUST be implemented by all drivers.
Spec Test Format
================

The spec tests format is an extension of `transactions spec tests <https://github.com/mongodb/specifications/blob/master/source/transactions/tests/README.rst>`_ with some additions:
The spec tests format is an extension of `transactions spec tests <https://github.com/mongodb/specifications/blob/master/source/transactions/tests/README.md>`_ with some additions:

- A ``json_schema`` to set on the collection used for operations.

Expand Down Expand Up @@ -182,7 +182,7 @@ Then for each element in ``tests``:

{"create": <collection>, "validator": {"$jsonSchema": <json_schema>}}

If ``encrypted_fields`` is defined in the test, the required collections and index described in `Create and Drop Collection Helpers <https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#queryable-encryption-create-and-drop-collection-helpers>`_ must be created:
If ``encrypted_fields`` is defined in the test, the required collections and index described in `Create and Drop Collection Helpers <https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.md#queryable-encryption-create-and-drop-collection-helpers>`_ must be created:

- Use the ``dropCollection`` helper with ``encrypted_fields`` as an option and writeConcern "majority".
- Use the ``createCollection`` helper with ``encrypted_fields`` as an option.
Expand Down Expand Up @@ -610,15 +610,15 @@ Using ``client_encrypted`` perform the following operations:

- ``{ "_id": "over_2mib_2", "unencrypted": <the string "a" repeated (2097152) times> }``

Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command monitoring <https://github.com/mongodb/specifications/tree/master/source/command-logging-and-monitoring/command-logging-and-monitoring.rst>`_.
Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command monitoring <https://github.com/mongodb/specifications/tree/master/source/command-logging-and-monitoring/command-logging-and-monitoring.md>`_.

#. Bulk insert the following:

- The document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_2mib_1", "unencrypted": < the string "a" repeated (2097152 - 2000) times > }``

- The document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_2mib_2", "unencrypted": < the string "a" repeated (2097152 - 2000) times > }``

Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command logging and monitoring <https://github.com/mongodb/specifications/tree/master/source/command-logging-and-monitoring/command-logging-and-monitoring.rst>`_.
Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command logging and monitoring <https://github.com/mongodb/specifications/tree/master/source/command-logging-and-monitoring/command-logging-and-monitoring.md>`_.

#. Insert ``{ "_id": "under_16mib", "unencrypted": <the string "a" repeated 16777216 - 2000 times>``.

Expand Down Expand Up @@ -1661,7 +1661,7 @@ Load the file `key1-document.json <https://github.com/mongodb/specifications/tre

Read the ``"_id"`` field of ``key1Document`` as ``key1ID``.

Drop and create the collection ``db.explicit_encryption`` using ``encryptedFields`` as an option. See `FLE 2 CreateCollection() and Collection.Drop() <https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#fle-2-createcollection-and-collection-drop>`_.
Drop and create the collection ``db.explicit_encryption`` using ``encryptedFields`` as an option. See `FLE 2 CreateCollection() and Collection.Drop() <https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.md#fle-2-createcollection-and-collection-drop>`_.

Drop and create the collection ``keyvault.datakeys``.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
import static org.mockito.Mockito.mock;

// Implementation of
// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst
// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md
// specification tests
@SuppressWarnings("deprecation")
@RunWith(Parameterized.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.concurrent.Callable;

// Implementation of
// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst
// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md
// specification tests
@RunWith(Parameterized.class)
public class ConnectionPoolAsyncTest extends AbstractConnectionPoolTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.concurrent.Callable;

// Implementation of
// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst
// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md
// specification tests
@RunWith(Parameterized.class)
public class ConnectionPoolTest extends AbstractConnectionPoolTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.mongodb.reactivestreams.client.syncadapter.SyncMongoClient;

/**
* See <a href="https://github.com/mongodb/specifications/blob/master/source/index-management/tests/README.rst#search-index-management-helpers">Search Index Management Tests</a>
* See <a href="https://github.com/mongodb/specifications/blob/master/source/index-management/tests/README.md#search-index-management-helpers">Search Index Management Tests</a>
*/
public class AtlasSearchIndexManagementProseTest extends AbstractAtlasSearchIndexManagementProseTest {
protected MongoClient createMongoClient(final MongoClientSettings settings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

/**
* See
* <a href="https://github.com/mongodb/specifications/blob/master/source/retryable-writes/tests/README.rst#prose-tests">Retryable Write Prose Tests</a>.
* <a href="https://github.com/mongodb/specifications/blob/master/source/retryable-writes/tests/README.md#prose-tests">Retryable Write Prose Tests</a>.
*/
public class RetryableWritesProseTest extends DatabaseTestCase {
private CollectionHelper<Document> collectionHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.rst#prose-tests
// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.md#prose-tests
public class WriteConcernProseTest extends DatabaseTestCase {
private BsonDocument failPointDocument;
private CollectionHelper<Document> collectionHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@

/**
* See prose tests in
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection-tests.rst">
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection-tests.md">
* "Server Selection Test Plan"</a>.
*/
public abstract class AbstractServerSelectionProseTest {
/**
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection-tests.rst#prose-test">
* <a href="https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection-tests.md#prose-test">
* {@code operationCount}-based Selection Within Latency Window</a>.
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import static org.junit.jupiter.api.Assumptions.assumeTrue;

// Prose tests for Sessions specification: https://github.com/mongodb/specifications/tree/master/source/sessions
// Prose test README: https://github.com/mongodb/specifications/tree/master/source/sessions/tests/README.rst
// Prose test README: https://github.com/mongodb/specifications/tree/master/source/sessions/tests/README.md
public abstract class AbstractSessionsProseTest {

private static final int MONGOCRYPTD_PORT = 47017;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.mongodb.MongoClientSettings;

/**
* See <a href="https://github.com/mongodb/specifications/blob/master/source/index-management/tests/README.rst#search-index-management-helpers">Search Index Management Tests</a>
* See <a href="https://github.com/mongodb/specifications/blob/master/source/index-management/tests/README.md#search-index-management-helpers">Search Index Management Tests</a>
*/
public class AtlasSearchIndexManagementProseTest extends AbstractAtlasSearchIndexManagementProseTest {
protected MongoClient createMongoClient(final MongoClientSettings settings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import static org.junit.jupiter.api.Assumptions.assumeTrue;


// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.rst#prose-tests
// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.md#prose-tests
public class ChangeStreamProseTest extends DatabaseTestCase {
private BsonDocument failPointDocument;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


/**
* See https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/tests/README.rst#prose-tests
* See https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/tests/README.md#prose-tests
*/
public final class ClientSideOperationTimeoutProseTest extends AbstractClientSideOperationsTimeoutProseTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

/**
* See
* <a href="https://github.com/mongodb/specifications/blob/master/source/retryable-writes/tests/README.rst#prose-tests">Retryable Write Prose Tests</a>.
* <a href="https://github.com/mongodb/specifications/blob/master/source/retryable-writes/tests/README.md#prose-tests">Retryable Write Prose Tests</a>.
*/
public class RetryableWritesProseTest extends DatabaseTestCase {

Expand Down Expand Up @@ -158,7 +158,7 @@ public static <R> void poolClearedExceptionMustBeRetryable(
.applyToServerSettings(builder -> builder
/* We fake server's state by configuring a fail point. This breaks the mechanism of the
* streaming server monitoring protocol
* (https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.rst#streaming-protocol)
* (https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.md#streaming-protocol)
* that allows the server to determine whether or not it needs to send a new state to the client.
* As a result, the client has to wait for at least its heartbeat delay until it hears back from a server
* (while it waits for a response, calling `ServerMonitor.connect` has no effect).
Expand Down
Loading