@@ -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