Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 0540e2d

Browse files
chore: generate libraries at Thu May 7 18:09:23 UTC 2026
1 parent bcd14ef commit 0540e2d

11 files changed

Lines changed: 55 additions & 32 deletions

File tree

google-cloud-firestore/src/main/java/com/google/cloud/firestore/Blob.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public static Blob createBsonBinary(@Nonnull ByteString data) {
8989
}
9090

9191
/**
92-
* Creates a new Blob instance representing a BSON binary data type with a specific subtype.
93-
* Sets representation to BSON.
92+
* Creates a new Blob instance representing a BSON binary data type with a specific subtype. Sets
93+
* representation to BSON.
9494
*
9595
* @param subtype The subtype to use for this instance.
9696
* @param bytes The bytes to use for this Blob instance.
@@ -102,8 +102,8 @@ public static Blob createBsonBinary(int subtype, @Nonnull byte[] bytes) {
102102
}
103103

104104
/**
105-
* Creates a new Blob instance representing a BSON binary data type with a specific subtype.
106-
* Sets representation to BSON.
105+
* Creates a new Blob instance representing a BSON binary data type with a specific subtype. Sets
106+
* representation to BSON.
107107
*
108108
* @param subtype The subtype to use for this instance.
109109
* @param data The ByteString to use for this Blob instance.
@@ -188,7 +188,9 @@ public String toString() {
188188
+ ", isBson="
189189
+ this.isBson
190190
+ ", data="
191-
+ com.google.common.io.BaseEncoding.base16().lowerCase().encode(this.byteString.toByteArray())
191+
+ com.google.common.io.BaseEncoding.base16()
192+
.lowerCase()
193+
.encode(this.byteString.toByteArray())
192194
+ "}";
193195
}
194196
}

google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentSnapshot.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ public BsonTimestamp getBsonTimestamp(@Nonnull String field) {
482482
return (BsonTimestamp) get(field);
483483
}
484484

485-
486-
487485
/**
488486
* Gets the reference to the document.
489487
*

google-cloud-firestore/src/main/java/com/google/cloud/firestore/Order.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ private int compareBsonTimestamp(Value left, Value right) {
424424
return secondsDiff != 0 ? secondsDiff : Long.compare(lhs.increment, rhs.increment);
425425
}
426426

427-
428-
429427
private boolean isNaN(Value value) {
430428
if (value.hasDoubleValue() && Double.isNaN(value.getDoubleValue())) {
431429
return true;

google-cloud-firestore/src/main/java/com/google/cloud/firestore/Quadruple.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public final class Quadruple implements Comparable<Quadruple>, Serializable {
3939
private final int biasedExponent;
4040
private final long mantHi;
4141
private final long mantLo;
42+
4243
/**
4344
* Build a new quadruple from its raw representation - sign, biased exponent, 128-bit mantissa.
4445
*
@@ -53,38 +54,47 @@ public Quadruple(boolean negative, int biasedExponent, long mantHi, long mantLo)
5354
this.mantHi = mantHi;
5455
this.mantLo = mantLo;
5556
}
57+
5658
/** Return the sign of this {@link Quadruple}. */
5759
public boolean negative() {
5860
return negative;
5961
}
62+
6063
/** Return the unsigned-32-bit biased exponent of this {@link Quadruple}. */
6164
public int biasedExponent() {
6265
return biasedExponent;
6366
}
67+
6468
/** Return the high-order unsigned-64-bits of the mantissa of this {@link Quadruple}. */
6569
public long mantHi() {
6670
return mantHi;
6771
}
72+
6873
/** Return the low-order unsigned-64-bits of the mantissa of this {@link Quadruple}. */
6974
public long mantLo() {
7075
return mantLo;
7176
}
77+
7278
/** Return the (unbiased) exponent of this {@link Quadruple}. */
7379
public int exponent() {
7480
return biasedExponent - QuadrupleBuilder.EXPONENT_BIAS;
7581
}
82+
7683
/** Return true if this {@link Quadruple} is -0 or +0 */
7784
public boolean isZero() {
7885
return biasedExponent == 0 && mantHi == 0 && mantLo == 0;
7986
}
87+
8088
/** Return true if this {@link Quadruple} is -infinity or +infinity */
8189
public boolean isInfinite() {
8290
return biasedExponent == (int) EXPONENT_OF_INFINITY && mantHi == 0 && mantLo == 0;
8391
}
92+
8493
/** Return true if this {@link Quadruple} is a NaN. */
8594
public boolean isNaN() {
8695
return biasedExponent == (int) EXPONENT_OF_INFINITY && !(mantHi == 0 && mantLo == 0);
8796
}
97+
8898
// equals (and hashCode) follow Double.equals: all NaNs are equal and -0 != 0
8999
@Override
90100
public boolean equals(Object other) {
@@ -116,6 +126,7 @@ public int hashCode() {
116126
}
117127

118128
private static final int HASH_NAN = 31 * 31 * Integer.hashCode((int) EXPONENT_OF_INFINITY);
129+
119130
// Compare two quadruples, with -0 < 0, and all NaNs equal and larger than all numbers.
120131
@Override
121132
public int compareTo(Quadruple other) {
@@ -211,6 +222,7 @@ public static Quadruple fromDouble(double value) {
211222
}
212223
return new Quadruple(value < 0, bias((int) (exponent - 1023)), mantHi, 0);
213224
}
225+
214226
/**
215227
* Converts a decimal number to a {@link Quadruple}. The supported format (no whitespace allowed)
216228
* is:

google-cloud-firestore/src/main/java/com/google/cloud/firestore/QuadrupleBuilder.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static QuadrupleBuilder parseDecimal(byte[] digits, int exp10) {
3838
q.parse(digits, exp10);
3939
return q;
4040
}
41+
4142
// The fields containing the value of the instance
4243
public int exponent;
4344
public long mantHi;
@@ -425,6 +426,7 @@ private int parseMantissa(byte[] digits, long[] mantissa) {
425426
}
426427
return expCorr;
427428
}
429+
428430
// Divides the unpacked value stored in the given buffer by 10
429431
// @param buffer contains the unpacked value to divide (32 least significant bits are used)
430432
private void divBuffBy10(long[] buffer) {
@@ -438,6 +440,7 @@ private void divBuffBy10(long[] buffer) {
438440
}
439441
}
440442
}
443+
441444
// Checks if the buffer is empty (contains nothing but zeros)
442445
// @param buffer the buffer to check
443446
// @return {@code true} if the buffer is empty, {@code false} otherwise
@@ -449,6 +452,7 @@ private boolean isEmpty(long[] buffer) {
449452
}
450453
return true;
451454
}
455+
452456
// Adds one to a decimal number represented as a sequence of decimal digits. propagates carry as
453457
// needed, so that {@code addCarryTo("6789") = "6790", addCarryTo("9999") = "10000"} etc.
454458
// @return 1 if an additional higher "1" was added in front of the number as a result of
@@ -466,6 +470,7 @@ private int addCarry(byte[] digits) {
466470
digits[0] = 1;
467471
return 1;
468472
}
473+
469474
// Finds binary exponent, using decimal exponent and mantissa.<br>
470475
// exp2 = exp10 * log<sub>2</sub>(10) + log<sub>2</sub>(mant)<br>
471476
// @param exp10 decimal exponent
@@ -479,6 +484,7 @@ private double findBinaryExponent(int exp10, long[] mantissa) {
479484
double mant10d = ((double) (mant10)) / TWO_POW_63_DIV_10;
480485
return ((long) Math.floor(((double) (exp10)) * LOG2_10 + log2(mant10d))); // Binary exponent
481486
}
487+
482488
// Calculates log<sub>2</sub> of the given x
483489
// @param x argument that can't be 0
484490
// @return the value of log<sub>2</sub>(x)
@@ -517,6 +523,7 @@ private void findBinaryMantissa(int exp10, double exp2, long[] mantissa) {
517523
this.mantLo = ((product[2] << 32L) + product[3]);
518524
}
519525
}
526+
520527
// Calculates the required power and returns the result in the quasidecimal format (an array of
521528
// longs, where result[0] is the decimal exponent of the resulting value, and result[1] --
522529
// result[3] contain 192 bits of the mantissa divided by ten (so that 8 looks like
@@ -557,12 +564,14 @@ private void powerOfTwo(double exp, long[] power) {
557564
currPowOf2 = currPowOf2 * 0.5; // Note: this is exact
558565
}
559566
}
567+
560568
// Copies from into to.
561569
private void array_copy(long[] source, long[] dest) {
562570
for (int i = (0); i < ((dest).length); i++) {
563571
dest[i] = source[i];
564572
}
565573
}
574+
566575
// Multiplies two quasidecimal numbers contained in buffers of 3 x 64 bits with exponents, puts
567576
// the product to <b><i>buffer4x64B</i></b><br>
568577
// and returns it. Both each of the buffers and the product contain 4 longs - exponent and 3 x 64
@@ -576,6 +585,7 @@ private void multPacked3x64_AndAdjustExponent(long[] factor1, long[] factor2, lo
576585
// result[0] is a signed int64 value stored in an uint64
577586
result[0] = factor1[0] + factor2[0] + ((long) (expCorr)); // product.exp = f1.exp + f2.exp
578587
}
588+
579589
// Multiplies mantissas of two packed quasidecimal values (each is an array of 4 longs, exponent +
580590
// 3 x 64 bits of mantissa) Returns the product as unpacked buffer of 12 x 32 (12 x 32 bits of
581591
// product)
@@ -604,6 +614,7 @@ private void multPacked3x64_simply(long[] factor1, long[] factor2, long[] result
604614
result[i] &= LOWER_32_BITS;
605615
}
606616
}
617+
607618
// Corrects possible underflow of the decimal mantissa, passed in in the {@code mantissa}, by
608619
// multiplying it by a power of ten. The corresponding value to adjust the decimal exponent is
609620
// returned as the result
@@ -617,6 +628,7 @@ private int correctPossibleUnderflow(long[] mantissa) {
617628
}
618629
return expCorr;
619630
}
631+
620632
// Checks if the unpacked quasidecimal value held in the given buffer is less than one (in this
621633
// format, one is represented as { 0x1999_9999L, 0x9999_9999L, 0x9999_9999L,...}
622634
// @param buffer a buffer containing the value to check
@@ -644,6 +656,7 @@ private boolean isLessThanOne(long[] buffer) {
644656
// and it can never reach this point in real life.
645657
return false; // Still Java requires the return statement here.
646658
}
659+
647660
// Multiplies unpacked 192-bit value by a packed 192-bit factor <br>
648661
// uses static arrays <b><i>buffer6x32B</i></b>
649662
// @param factor1 a buffer containing unpacked quasidecimal mantissa (6 x 32 bits)
@@ -669,6 +682,7 @@ private void multUnpacked6x32byPacked(long[] factor1, long[] factor2, long[] pro
669682
product[i] &= LOWER_32_BITS;
670683
}
671684
}
685+
672686
// Multiplies the unpacked value stored in the given buffer by 10
673687
// @param buffer contains the unpacked value to multiply (32 least significant bits are used)
674688
private void multBuffBy10(long[] buffer) {
@@ -680,6 +694,7 @@ private void multBuffBy10(long[] buffer) {
680694
buffer[i + 1] &= LOWER_32_BITS;
681695
}
682696
}
697+
683698
// Makes sure that the (unpacked) mantissa is normalized,
684699
// i.e. buff[0] contains 1 in bit 32 (the implied integer part) and higher 32 of mantissa in bits
685700
// 31..0,
@@ -696,6 +711,7 @@ private int normalizeMant(long[] mantissa) {
696711
}
697712
return expCorr;
698713
}
714+
699715
// Rounds up the contents of the unpacked buffer to 128 bits by adding unity one bit lower than
700716
// the lowest of these 128 bits. If carry propagates up to bit 33 of buff[0], shifts the buffer
701717
// rightwards to keep it normalized.
@@ -726,6 +742,7 @@ private int roundUp(long[] mantissa) {
726742
}
727743
return 0;
728744
}
745+
729746
// converts 192 most significant bits of the mantissa of a number from an unpacked quasidecimal
730747
// form (where 32 least significant bits only used) to a packed quasidecimal form (where buff[0]
731748
// contains the exponent and buff[1]..buff[3] contain 3 x 64 = 192 bits of mantissa)
@@ -738,6 +755,7 @@ private void pack_6x32_to_3x64(long[] unpackedMant, long[] result) {
738755
result[2] = (unpackedMant[2] << 32L) + unpackedMant[3];
739756
result[3] = (unpackedMant[4] << 32L) + unpackedMant[5];
740757
}
758+
741759
// Unpacks the mantissa of a 192-bit quasidecimal (4 longs: exp10, mantHi, mantMid, mantLo) to a
742760
// buffer of 6 longs, where the least significant 32 bits of each long contains respective 32 bits
743761
// of the mantissa
@@ -751,6 +769,7 @@ private void unpack_3x64_to_6x32(long[] qd192, long[] buff_6x32) {
751769
buff_6x32[4] = ((qd192[3]) >>> (32L));
752770
buff_6x32[5] = qd192[3] & LOWER_32_BITS;
753771
}
772+
754773
// Divides the contents of the buffer by 2^exp2<br>
755774
// (shifts the buffer rightwards by exp2 if the exp2 is positive, and leftwards if it's negative),
756775
// keeping it unpacked (only lower 32 bits of each element are used, except the buff[0] whose
@@ -778,6 +797,7 @@ private void divBuffByPower2(long[] buffer, int exp2) {
778797
buffer[maxIdx] = (buffer[maxIdx] << exp2Shift) & LOWER_32_BITS;
779798
}
780799
}
800+
781801
// Adds the summand to the idx'th word of the unpacked value stored in the buffer
782802
// and propagates carry as necessary
783803
// @param buff the buffer to add the summand to

google-cloud-firestore/src/main/java/com/google/cloud/firestore/UserDataConverter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ static Value encodeValue(
174174
} else if (sanitizedObject instanceof Blob) {
175175
Blob blob = (Blob) sanitizedObject;
176176
if (blob.isBson() && blob.subtype() != 0) {
177-
return Value.newBuilder().setMapValue(encodeBsonBinaryData(blob.subtype(), blob.toByteString())).build();
177+
return Value.newBuilder()
178+
.setMapValue(encodeBsonBinaryData(blob.subtype(), blob.toByteString()))
179+
.build();
178180
} else {
179181
return Value.newBuilder().setBytesValue(blob.toByteString()).build();
180182
}
@@ -233,7 +235,6 @@ static Value encodeValue(
233235
} else if (sanitizedObject instanceof BsonTimestamp) {
234236
BsonTimestamp bsonTimestamp = (BsonTimestamp) sanitizedObject;
235237
return Value.newBuilder().setMapValue(bsonTimestamp.toProto()).build();
236-
237238
}
238239

239240
throw FirestoreException.forInvalidArgument(

google-cloud-firestore/src/main/java/com/google/cloud/firestore/encoding/CustomClassMapper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.google.api.core.InternalApi;
2020
import com.google.cloud.Timestamp;
2121
import com.google.cloud.firestore.Blob;
22-
2322
import com.google.cloud.firestore.BsonObjectId;
2423
import com.google.cloud.firestore.BsonTimestamp;
2524
import com.google.cloud.firestore.Decimal128Value;
@@ -171,7 +170,6 @@ static <T> Object serialize(T o, DeserializeContext.ErrorPath path) {
171170
|| o instanceof Decimal128Value
172171
|| o instanceof BsonTimestamp
173172
|| o instanceof BsonObjectId
174-
175173
|| o instanceof GeoPoint
176174
|| o instanceof Blob
177175
|| o instanceof DocumentReference

google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,7 @@ public boolean equals(Object o) {
11521152
ALL_SUPPORTED_TYPES_MAP.put("decimal128Value", new Decimal128Value("1.2e3"));
11531153
ALL_SUPPORTED_TYPES_MAP.put("bsonObjectId", new BsonObjectId("507f191e810c19729de860eb"));
11541154
ALL_SUPPORTED_TYPES_MAP.put("bsonTimestamp", new BsonTimestamp(100, 10));
1155-
ALL_SUPPORTED_TYPES_MAP.put(
1156-
"bsonBinaryData", Blob.createBsonBinary(127, new byte[] {1, 2, 3}));
1155+
ALL_SUPPORTED_TYPES_MAP.put("bsonBinaryData", Blob.createBsonBinary(127, new byte[] {1, 2, 3}));
11571156
ALL_SUPPORTED_TYPES_PROTO =
11581157
ImmutableMap.<String, Value>builder()
11591158
.put("foo", Value.newBuilder().setStringValue("bar").build())

google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
import com.google.api.gax.rpc.StatusCode;
118118
import com.google.cloud.Timestamp;
119119
import com.google.cloud.firestore.Blob;
120-
121120
import com.google.cloud.firestore.CollectionReference;
122121
import com.google.cloud.firestore.DocumentReference;
123122
import com.google.cloud.firestore.DocumentSnapshot;
@@ -434,17 +433,17 @@ public void canFilterAndOrderBlobWithSubtypes() throws Exception {
434433
firestore
435434
.pipeline()
436435
.createFrom(coll)
437-
.where(Expression.greaterThan(field("key"), constant(Blob.createBsonBinary(1, new byte[] {1, 2, 3}))))
436+
.where(
437+
Expression.greaterThan(
438+
field("key"), constant(Blob.createBsonBinary(1, new byte[] {1, 2, 3}))))
438439
.sort(field("key").descending())
439440
.execute()
440441
.get()
441442
.getResults();
442443

443444
List<Map<String, Object>> resultData = data(results);
444445
// Expected: doc3 (subtype 2), then doc2 (subtype 1, data larger)
445-
assertThat(resultData)
446-
.containsExactly(data.get("doc3"), data.get("doc2"))
447-
.inOrder();
446+
assertThat(resultData).containsExactly(data.get("doc3"), data.get("doc2")).inOrder();
448447
}
449448

450449
private String stringOfOrderedKeyValues(Map<String, Object> map) {

google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryWatchTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@
2525
import static java.util.Collections.singletonList;
2626
import static org.junit.Assert.assertArrayEquals;
2727
import static org.junit.Assert.assertEquals;
28-
29-
import com.google.api.core.ApiFuture;
3028
import static org.junit.Assume.assumeTrue;
3129

30+
import com.google.api.core.ApiFuture;
3231
import com.google.api.core.ApiFutures;
3332
import com.google.cloud.Timestamp;
3433
import com.google.cloud.firestore.Blob;
35-
3634
import com.google.cloud.firestore.BsonObjectId;
3735
import com.google.cloud.firestore.BsonTimestamp;
3836
import com.google.cloud.firestore.CollectionReference;
@@ -976,15 +974,16 @@ public void canFilterBlobWithSubtypeZero() throws Exception {
976974
assumeTrue(getFirestoreEdition() == FirestoreEdition.ENTERPRISE);
977975
Map<String, Map<String, Object>> data =
978976
map(
979-
"doc1", map("key", Blob.fromBytes(new byte[] {1, 2, 3})), // Native (subtype 0 implicitly)
977+
"doc1",
978+
map("key", Blob.fromBytes(new byte[] {1, 2, 3})), // Native (subtype 0 implicitly)
980979
"doc2", map("key", Blob.createBsonBinary(new byte[] {1, 2, 3})), // BSON with subtype 0
981-
"doc3", map("key", Blob.createBsonBinary(1, new byte[] {1, 2, 3}))); // BSON with subtype 1
980+
"doc3",
981+
map("key", Blob.createBsonBinary(1, new byte[] {1, 2, 3}))); // BSON with subtype 1
982982
addDocs(data);
983983

984984
// Query for native blob
985985
QuerySnapshot snapshot =
986-
getFirstSnapshot(
987-
randomColl.whereEqualTo("key", Blob.fromBytes(new byte[] {1, 2, 3})));
986+
getFirstSnapshot(randomColl.whereEqualTo("key", Blob.fromBytes(new byte[] {1, 2, 3})));
988987
List<Map<String, Object>> resultData = toDataArray(snapshot);
989988
// Should match both doc1 and doc2!
990989
assertThat(resultData).containsExactly(data.get("doc1"), data.get("doc2"));

0 commit comments

Comments
 (0)