Skip to content

Commit 8bbe51a

Browse files
Format
1 parent 8ec4de0 commit 8bbe51a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalStore.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public ImmutableSortedMap<DocumentKey, MaybeDocument> applyRemoteEvent(RemoteEve
412412
* Populates the remote document cache with documents from backend or a bundle. Returns the
413413
* document changes resulting from applying those documents.
414414
*
415-
* Note: this function will use `documentVersions` if it is defined. When it is not defined, it
415+
* <p>Note: this function will use `documentVersions` if it is defined. When it is not defined, it
416416
* resorts to `globalVersion`.
417417
*
418418
* @param documents Documents to be applied.
@@ -613,13 +613,14 @@ TargetData getTargetData(Target target) {
613613
* newer than the currently loading bundle.
614614
*/
615615
public boolean hasNewerBundle(BundleMetadata bundleMetadata) {
616-
return persistence.runTransaction(
617-
"Has newer bundle", () -> {
618-
BundleMetadata existingMetadata = bundleCache.getBundleMetadata(bundleMetadata.getBundleId());
619-
return existingMetadata != null
620-
&& existingMetadata.getCreateTime().compareTo(bundleMetadata.getCreateTime()) > 0;
621-
});
622-
616+
return persistence.runTransaction(
617+
"Has newer bundle",
618+
() -> {
619+
BundleMetadata existingMetadata =
620+
bundleCache.getBundleMetadata(bundleMetadata.getBundleId());
621+
return existingMetadata != null
622+
&& existingMetadata.getCreateTime().compareTo(bundleMetadata.getCreateTime()) > 0;
623+
});
623624
}
624625

625626
/** Saves the given BundleMetadata to local persistence. */
@@ -664,7 +665,7 @@ public ImmutableSortedMap<DocumentKey, MaybeDocument> applyBundledDocuments(
664665
targetCache.addMatchingKeys(documentKeys, umbrellaTargetData.getTargetId());
665666

666667
Map<DocumentKey, MaybeDocument> changedDocs =
667-
populateDocumentChanges(documentMap, versionMap, SnapshotVersion.NONE);
668+
populateDocumentChanges(documentMap, versionMap, SnapshotVersion.NONE);
668669
return localDocuments.getLocalViewOfDocuments(changedDocs);
669670
});
670671
}
@@ -700,8 +701,7 @@ public void saveNamedQuery(NamedQuery namedQuery, ImmutableSortedSet<DocumentKey
700701
/** Returns the NameQuery associated with queryName or null if not found. */
701702
public @Nullable NamedQuery getNamedQuery(String queryName) {
702703
return persistence.runTransaction(
703-
"Get named query",
704-
() -> bundleCache.getNamedQuery(queryName));
704+
"Get named query", () -> bundleCache.getNamedQuery(queryName));
705705
}
706706

707707
/** Mutable state for the transaction in allocateQuery. */

firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalStoreTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ private void assertHasNewerBundle(String bundleId, int createTime) {
275275

276276
private void assertNoNewerBundle(String bundleId, int createTime) {
277277
boolean hasNewerBundle =
278-
localStore.hasNewerBundle(
279-
new BundleMetadata(bundleId, /* version= */ 1, version(createTime)));
278+
localStore.hasNewerBundle(
279+
new BundleMetadata(bundleId, /* version= */ 1, version(createTime)));
280280
assertFalse(hasNewerBundle);
281281
}
282282

0 commit comments

Comments
 (0)