Skip to content

Commit 891c1a9

Browse files
---
yaml --- r: 9041 b: "refs/heads/mrschmidt-__name___" c: effe274 h: refs/heads/master i: 9039: 0f829c7
1 parent 3e5c99e commit 891c1a9

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

  • branches/mrschmidt-__name___/google-cloud-firestore/src/main/java/com/google/cloud/firestore

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ refs/tags/v0.29.0: d702b33b70f2e81853a142b4158227c5a88c8781
8888
refs/tags/v0.30.0: 9ea3a32084835d0499934e7c070af9f120747e88
8989
refs/heads/batching-expr: 95bc1ac20addaeb25ef65f62450593ed600484b9
9090
"refs/heads/datastore_orderby_tostring": 24a5a107969714ebb69a5a098f47658f7b1e8689
91-
"refs/heads/mrschmidt-__name___": 94949f1f33fa1272a3702b0f7a89c9102f0dc713
91+
"refs/heads/mrschmidt-__name___": effe27458f7d31b1d5ae1af6a5a228ce89c33462

branches/mrschmidt-__name___/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -369,33 +369,31 @@ private Cursor createCursor(List<FieldOrder> order, Object[] fieldValues, boolea
369369
* a DocumentReference that can directly be used in the Query.
370370
*/
371371
private Object convertReference(Object fieldValue) {
372-
Object sanitizedValue;
373-
DocumentReference cursorDocument;
372+
DocumentReference reference;
374373
if (fieldValue instanceof String) {
375-
cursorDocument = new DocumentReference(firestore, path.append((String) fieldValue));
374+
reference = new DocumentReference(firestore, path.append((String) fieldValue));
376375
} else if (fieldValue instanceof DocumentReference) {
377-
cursorDocument = (DocumentReference) fieldValue;
376+
reference = (DocumentReference) fieldValue;
378377
} else {
379378
throw new IllegalArgumentException(
380379
"The corresponding value for FieldPath.documentId() must be a String or a "
381380
+ "DocumentReference.");
382381
}
383382

384-
if (!this.path.isPrefixOf(cursorDocument.getResourcePath())) {
383+
if (!this.path.isPrefixOf(reference.getResourcePath())) {
385384
throw new IllegalArgumentException(
386385
String.format(
387386
"'%s' is not part of the query result set and cannot be used as a query boundary.",
388-
cursorDocument.getPath()));
387+
reference.getPath()));
389388
}
390-
if (!cursorDocument.getParent().getResourcePath().equals(this.path)) {
389+
if (!reference.getParent().getResourcePath().equals(this.path)) {
391390
throw new IllegalArgumentException(
392391
String.format(
393392
"Only a direct child can be used as a query boundary. Found: '%s'",
394-
cursorDocument.getPath()));
393+
reference.getPath()));
395394
}
396395

397-
sanitizedValue = cursorDocument;
398-
return sanitizedValue;
396+
return reference;
399397
}
400398

401399
/**

0 commit comments

Comments
 (0)