Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
bcc22ba
Allow valid SRV hostnames with less than 3 parts (#1534)
NathanQingyangXu Oct 18, 2024
51aa520
Merge branch 'mongodb:main' into main
nhachicha Nov 11, 2024
4e9b7db
Merge branch 'mongodb:main' into main
nhachicha Jan 13, 2025
96d0c6b
Remove assertion for verbose result (#1835)
vbabanin Dec 3, 2025
69a3c1d
evergreen git clone depth is 1 (#1851)
strogiyotec Dec 5, 2025
662c519
Merge branch 'mongodb:main' into main
nhachicha Dec 9, 2025
5cb23ba
Updated specifications submodule to latest
rozza Dec 15, 2025
07a7357
Fixes JAVA-6023, align log level to warning from error when removing …
nhachicha Dec 18, 2025
abdf56a
Merge branch 'mongodb:main' into main
nhachicha Dec 18, 2025
7408493
Reuse ConnectionSource to avoid extra server selection. (#1813)
vbabanin Dec 18, 2025
cece170
JAVA-4320 fix server selection flaky test (#1847)
strogiyotec Jan 3, 2026
139eee0
encryptionClient uses writeConcern majority (#1858)
strogiyotec Jan 5, 2026
7200ed9
[JAVA-6043](https://jira.mongodb.org/browse/JAVA-6043) (#1859)
strogiyotec Jan 6, 2026
d3b0060
Merge branch 'mongodb:main' into main
nhachicha Jan 14, 2026
6fd2c95
Handle unexpected end of stream errors from KMS. (#1849)
vbabanin Jan 15, 2026
6630fe2
JAVA-5988 (#1862)
strogiyotec Jan 16, 2026
2a26a16
Version: bump 5.7.0-beta0
strogiyotec Jan 16, 2026
e2f5c40
Version: bump 5.7.0-SNAPSHOT
strogiyotec Jan 16, 2026
1ed116f
JAVA-5950 - Update Transactions Convenient API with exponential back…
nhachicha Dec 3, 2025
eb8b4ad
Simplifying test, clean up.
nhachicha Dec 9, 2025
b8b0e1a
Fixing test
nhachicha Dec 9, 2025
c05ce05
Update driver-sync/src/main/com/mongodb/client/internal/ClientSession…
nhachicha Dec 9, 2025
aa96659
retrigger checks
nhachicha Dec 9, 2025
98fc57b
retrigger checks
nhachicha Dec 9, 2025
f98262e
retrigger checks
nhachicha Dec 9, 2025
bfc89fc
retrigger checks
nhachicha Dec 9, 2025
d9405ef
test cleanup
nhachicha Dec 9, 2025
5de452b
retrigger checks
nhachicha Dec 9, 2025
1867ff5
Test cleanup
nhachicha Dec 9, 2025
f89d62d
retrigger checks
nhachicha Dec 10, 2025
3d646ae
Update the implementation according to the spec
nhachicha Dec 10, 2025
9b4bf15
Added prose test
nhachicha Dec 10, 2025
da83704
Flaky test
nhachicha Dec 10, 2025
cb95167
Remove extra Test annotation
nhachicha Dec 11, 2025
ef734a0
Throwing correct exception when CSOT is used
nhachicha Dec 14, 2025
96b5ed7
Simplifying implementation by relying on CSOT to throw when timeout i…
nhachicha Dec 14, 2025
43eda52
Fixing implementation according to spec changes in JAVA-6046 and http…
nhachicha Jan 13, 2026
a4193dd
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 13, 2026
f2d8263
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
f3daab0
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
7afd9d4
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
ccb8d03
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
bbb9a68
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
c44872d
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
f0dd916
Update driver-core/src/main/com/mongodb/internal/ExponentialBackoff.java
nhachicha Jan 14, 2026
0e00c90
PR feedback
nhachicha Jan 15, 2026
36ecbf9
remove annotation
nhachicha Jan 16, 2026
ad43095
improve git clone for mongo tools repository (#1866)
strogiyotec Jan 21, 2026
b922075
Bson specification testing
rozza Jan 26, 2026
475aa6c
generate sarif (#1869)
strogiyotec Jan 26, 2026
4cea337
Fix/improve ClientSessionImpl, remove ClientSessionClock
stIncMale Jan 26, 2026
8bc1de2
PR feedback
nhachicha Jan 29, 2026
cae949e
Reduce flakiness in CSOT tests using withTransaction, by forcing an i…
nhachicha Jan 29, 2026
6a17834
Using correct jitter value in CSOT tests using withTransaction
nhachicha Jan 29, 2026
98b8d28
Guarding setting a custom jitter for only sync tests
nhachicha Jan 29, 2026
5560012
Temp disable large encryption tests on mongocryptd (#1872)
rozza Jan 29, 2026
ddfe918
PR feedback
nhachicha Feb 2, 2026
371d637
Merge branch 'mongodb:main' into main
nhachicha Feb 2, 2026
c97073e
PR feedback
nhachicha Feb 2, 2026
f0973a1
Fixing unit test
nhachicha Feb 2, 2026
1655dad
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Feb 12, 2026
f5274cb
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Feb 12, 2026
8105760
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Feb 12, 2026
56fe91b
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Feb 12, 2026
7730fc6
- PR feedback
nhachicha Feb 12, 2026
9714fb8
Merge remote-tracking branch 'nabil' into nh/withTransaction_delay
nhachicha Feb 12, 2026
6ef5ca9
Merge remote-tracking branch 'nabil/nh/withTransaction_delay' into nh…
nhachicha Feb 12, 2026
a4d90d0
moved logic of ExponentialBackoff cleanup to correct class
nhachicha Feb 12, 2026
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
2 changes: 1 addition & 1 deletion .evergreen/.evg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ functions:
# If this was a patch build, doing a fresh clone would not actually test the patch
cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS
else
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
git clone --depth 1 https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
fi
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config

Expand Down
4 changes: 4 additions & 0 deletions .evergreen/ssdlc-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ printf "\nSpotBugs created the following SARIF reports\n"
IFS=$'\n'
declare -a SARIF_PATHS=($(find "${RELATIVE_DIR_PATH}/.." -path "*/spotbugs/*.sarif"))
unset IFS
if [ ${#SARIF_PATHS[@]} -eq 0 ]; then
printf "\nERROR: No SARIF files found matching pattern */spotbugs/*.sarif\n"
exit 1
fi
for SARIF_PATH in "${SARIF_PATHS[@]}"; do
GRADLE_PROJECT_NAME="$(basename "$(dirname "$(dirname "$(dirname "$(dirname "${SARIF_PATH}")")")")")"
NEW_SARIF_PATH="${SSDLC_STATIC_ANALYSIS_REPORTS_PATH}/${GRADLE_PROJECT_NAME}_$(basename "${SARIF_PATH}")"
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "specifications"]
path = driver-core/src/test/resources/specifications
path = testing/resources/specifications
url = https://github.com/mongodb/specifications
5 changes: 5 additions & 0 deletions bson/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ plugins {

base.archivesName.set("bson")

tasks.processTestResources {
from("${rootProject.projectDir}/testing/resources")
into("${layout.buildDirectory.get()}/resources/test")
}

configureMavenPublication {
pom {
name.set("BSON")
Expand Down
11 changes: 3 additions & 8 deletions bson/src/main/org/bson/BinaryVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

import org.bson.annotations.Beta;
import org.bson.annotations.Reason;

import static org.bson.assertions.Assertions.isTrueArgument;
import static org.bson.assertions.Assertions.notNull;
import org.bson.diagnostics.Logger;
import org.bson.diagnostics.Loggers;

/**
* Binary Vectors are densely packed arrays of numbers, all the same type, which are stored and retrieved efficiently using the BSON Binary
Expand All @@ -33,6 +32,7 @@
* @since 5.3
*/
public abstract class BinaryVector {
protected static final Logger LOGGER = Loggers.getLogger("BinaryVector");
private final DataType dataType;

BinaryVector(final DataType dataType) {
Expand Down Expand Up @@ -64,9 +64,6 @@ public abstract class BinaryVector {
*/
@Beta(Reason.SERVER)
public static PackedBitBinaryVector packedBitVector(final byte[] data, final byte padding) {
notNull("data", data);
isTrueArgument("Padding must be between 0 and 7 bits. Provided padding: " + padding, padding >= 0 && padding <= 7);
isTrueArgument("Padding must be 0 if vector is empty. Provided padding: " + padding, padding == 0 || data.length > 0);
return new PackedBitBinaryVector(data, padding);
}

Expand All @@ -83,7 +80,6 @@ public static PackedBitBinaryVector packedBitVector(final byte[] data, final byt
* @return A {@link Int8BinaryVector} instance with the {@link DataType#INT8} data type.
*/
public static Int8BinaryVector int8Vector(final byte[] data) {
notNull("data", data);
return new Int8BinaryVector(data);
}

Expand All @@ -99,7 +95,6 @@ public static Int8BinaryVector int8Vector(final byte[] data) {
* @return A {@link Float32BinaryVector} instance with the {@link DataType#FLOAT32} data type.
*/
public static Float32BinaryVector floatVector(final float[] data) {
notNull("data", data);
return new Float32BinaryVector(data);
}

Expand Down
8 changes: 4 additions & 4 deletions bson/src/main/org/bson/Float32BinaryVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import java.util.Arrays;

import static org.bson.assertions.Assertions.assertNotNull;
import static org.bson.assertions.Assertions.notNull;

/**
* Represents a vector of 32-bit floating-point numbers, where each element in the vector is a float.
Expand All @@ -35,9 +35,9 @@ public final class Float32BinaryVector extends BinaryVector {

private final float[] data;

Float32BinaryVector(final float[] vectorData) {
Float32BinaryVector(final float[] data) {
super(DataType.FLOAT32);
this.data = assertNotNull(vectorData);
this.data = notNull("data", data);
}

/**
Expand All @@ -49,7 +49,7 @@ public final class Float32BinaryVector extends BinaryVector {
* @return the underlying float array representing this {@link Float32BinaryVector} vector.
*/
public float[] getData() {
return assertNotNull(data);
return data;
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions bson/src/main/org/bson/Int8BinaryVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Arrays;
import java.util.Objects;

import static org.bson.assertions.Assertions.assertNotNull;
import static org.bson.assertions.Assertions.notNull;

/**
* Represents a vector of 8-bit signed integers, where each element in the vector is a byte.
Expand All @@ -38,7 +38,7 @@ public final class Int8BinaryVector extends BinaryVector {

Int8BinaryVector(final byte[] data) {
super(DataType.INT8);
this.data = assertNotNull(data);
this.data = notNull("data", data);
}

/**
Expand All @@ -50,7 +50,7 @@ public final class Int8BinaryVector extends BinaryVector {
* @return the underlying byte array representing this {@link Int8BinaryVector} vector.
*/
public byte[] getData() {
return assertNotNull(data);
return data;
}

@Override
Expand Down
13 changes: 12 additions & 1 deletion bson/src/main/org/bson/PackedBitBinaryVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.Objects;

import static org.bson.assertions.Assertions.assertNotNull;
import static org.bson.assertions.Assertions.isTrueArgument;
import static org.bson.assertions.Assertions.notNull;

/**
* Represents a packed bit vector, where each element of the vector is represented by a single bit (0 or 1).
Expand All @@ -43,8 +45,17 @@ public final class PackedBitBinaryVector extends BinaryVector {

PackedBitBinaryVector(final byte[] data, final byte padding) {
super(DataType.PACKED_BIT);
this.data = assertNotNull(data);
this.data = notNull("data", data);
this.padding = padding;
isTrueArgument("Padding must be between 0 and 7 bits. Provided padding: " + padding, padding >= 0 && padding <= 7);
isTrueArgument("Padding must be 0 if vector is empty. Provided padding: " + padding, padding == 0 || data.length > 0);
if (padding > 0) {
int mask = (1 << padding) - 1;
if ((data[data.length - 1] & mask) != 0) {
// JAVA-5848 in version 6.0.0 will convert this logging into an IllegalArgumentException
LOGGER.warn("The last " + padding + " padded bits should be zero in the final byte.");
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExtendedJsonDoubleConverter implements Converter<Double> {
public void convert(final Double value, final StrictJsonWriter writer) {
writer.writeStartObject();
writer.writeName("$numberDouble");
writer.writeString(Double.toString(value));
writer.writeString(JsonDoubleHelper.toString(value));
writer.writeEndObject();

}
Expand Down
2 changes: 1 addition & 1 deletion bson/src/main/org/bson/json/JsonDoubleConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
class JsonDoubleConverter implements Converter<Double> {
@Override
public void convert(final Double value, final StrictJsonWriter writer) {
writer.writeNumber(Double.toString(value));
writer.writeNumber(JsonDoubleHelper.toString(value));
}
}
32 changes: 32 additions & 0 deletions bson/src/main/org/bson/json/JsonDoubleHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.bson.json;

import java.util.regex.Pattern;

final class JsonDoubleHelper {

private static final Pattern POSITIVE_EXPONENT_PATTERN = Pattern.compile("E(\\d+)");
private static final String POSITIVE_EXPONENT_REPLACER = "E+$1";

static String toString(final double value) {
String doubleString = Double.toString(value);
return POSITIVE_EXPONENT_PATTERN.matcher(doubleString).replaceAll(POSITIVE_EXPONENT_REPLACER);
}

private JsonDoubleHelper() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void convert(final Double value, final StrictJsonWriter writer) {
if (value.isNaN() || value.isInfinite()) {
FALLBACK_CONVERTER.convert(value, writer);
} else {
writer.writeNumber(Double.toString(value));
writer.writeNumber(JsonDoubleHelper.toString(value));
}
}
}
50 changes: 0 additions & 50 deletions bson/src/test/resources/bson-binary-vector/float32.json

This file was deleted.

56 changes: 0 additions & 56 deletions bson/src/test/resources/bson-binary-vector/int8.json

This file was deleted.

Loading