Skip to content

Commit 2857711

Browse files
committed
Add missing @nonnull annotation
1 parent c6d0361 commit 2857711

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ public <TResult> Task<TResult> runTransaction(
461461
* @param updateFunction The function to execute within the transaction context.
462462
* @return The task returned from the updateFunction.
463463
*/
464+
@NonNull
464465
public <TResult> Task<TResult> runTransaction(
465466
@NonNull TransactionOptions options, @NonNull Transaction.Function<TResult> updateFunction) {
466467
checkNotNull(updateFunction, "Provided transaction update function must not be null.");

firebase-firestore/src/main/java/com/google/firebase/firestore/TransactionOptions.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
package com.google.firebase.firestore;
1616

17+
import androidx.annotation.NonNull;
18+
1719
/**
1820
* Parameter for {@link FirebaseFirestore#runTransaction(TransactionOptions, Transaction.Function)}.
1921
*/
@@ -39,7 +41,7 @@ public Builder() {}
3941
* Constructs a new {@code TransactionOptions} Builder based on an existing {@code
4042
* TransactionOptions} object.
4143
*/
42-
public Builder(TransactionOptions options) {
44+
public Builder(@NonNull TransactionOptions options) {
4345
maxAttempts = options.maxAttempts;
4446
}
4547

@@ -48,6 +50,7 @@ public Builder(TransactionOptions options) {
4850
*
4951
* @return this builder
5052
*/
53+
@NonNull
5154
public Builder setMaxAttempts(int maxAttempts) {
5255
if (maxAttempts < 1) throw new IllegalArgumentException("Max attempts must be at least 1");
5356
this.maxAttempts = maxAttempts;
@@ -59,6 +62,7 @@ public Builder setMaxAttempts(int maxAttempts) {
5962
*
6063
* @return the built {@code TransactionOptions} object
6164
*/
65+
@NonNull
6266
public TransactionOptions build() {
6367
return new TransactionOptions(maxAttempts);
6468
}

0 commit comments

Comments
 (0)