@@ -209,7 +209,7 @@ private Map<DocumentKey, MutableDocument> getAll(
209
209
List <ResourcePath > collections ,
210
210
IndexOffset offset ,
211
211
int count ,
212
- @ Nullable DocumentType filterDocumentType ,
212
+ @ Nullable DocumentType tryFilterDocumentType ,
213
213
@ Nullable Function <MutableDocument , Boolean > filter ,
214
214
@ Nullable QueryContext context ) {
215
215
Timestamp readTime = offset .getReadTime ().getTimestamp ();
@@ -220,7 +220,7 @@ private Map<DocumentKey, MutableDocument> getAll(
220
220
"SELECT contents, read_time_seconds, read_time_nanos, path "
221
221
+ "FROM remote_documents "
222
222
+ "WHERE path >= ? AND path < ? AND path_length = ? "
223
- + (filterDocumentType == null
223
+ + (tryFilterDocumentType == null
224
224
? ""
225
225
: " AND (document_type IS NULL OR document_type = ?) " )
226
226
+ "AND (read_time_seconds > ? OR ( "
@@ -232,15 +232,16 @@ private Map<DocumentKey, MutableDocument> getAll(
232
232
233
233
Object [] bindVars =
234
234
new Object
235
- [(BINDS_PER_STATEMENT + (filterDocumentType != null ? 1 : 0 )) * collections .size () + 1 ];
235
+ [(BINDS_PER_STATEMENT + (tryFilterDocumentType != null ? 1 : 0 )) * collections .size ()
236
+ + 1 ];
236
237
int i = 0 ;
237
238
for (ResourcePath collection : collections ) {
238
239
String prefixPath = EncodedPath .encode (collection );
239
240
bindVars [i ++] = prefixPath ;
240
241
bindVars [i ++] = EncodedPath .prefixSuccessor (prefixPath );
241
242
bindVars [i ++] = collection .length () + 1 ;
242
- if (filterDocumentType != null ) {
243
- bindVars [i ++] = filterDocumentType .dbValue ;
243
+ if (tryFilterDocumentType != null ) {
244
+ bindVars [i ++] = tryFilterDocumentType .dbValue ;
244
245
}
245
246
bindVars [i ++] = readTime .getSeconds ();
246
247
bindVars [i ++] = readTime .getSeconds ();
@@ -272,7 +273,7 @@ private Map<DocumentKey, MutableDocument> getAll(
272
273
int count ,
273
274
@ Nullable Function <MutableDocument , Boolean > filter ) {
274
275
return getAll (
275
- collections , offset , count , /*filterDocumentType */ null , filter , /*context*/ null );
276
+ collections , offset , count , /*tryFilterDocumentType */ null , filter , /*context*/ null );
276
277
}
277
278
278
279
private void processRowInBackground (
@@ -315,7 +316,7 @@ public Map<DocumentKey, MutableDocument> getDocumentsMatchingQuery(
315
316
Collections .singletonList (query .getPath ()),
316
317
offset ,
317
318
Integer .MAX_VALUE ,
318
- // Specify filterDocumentType =FOUND_DOCUMENT to getAll() as an optimization, because
319
+ // Specify tryFilterDocumentType =FOUND_DOCUMENT to getAll() as an optimization, because
319
320
// query.matches(doc) will return false for all non-"found" document types anyways.
320
321
// See https://github.com/firebase/firebase-android-sdk/issues/7295
321
322
DocumentType .FOUND_DOCUMENT ,
0 commit comments