Skip to content

Commit 1f34778

Browse files
committed
resolve comments
1 parent f75e734 commit 1f34778

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/remote/BloomFilter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ public class BloomFilter {
2727
private final int hashCount;
2828
private final MessageDigest md5HashMessageDigest;
2929

30-
public BloomFilter(@NonNull byte[] bitmap, int padding, int hashCount)
31-
throws BloomFilterException {
30+
public BloomFilter(@NonNull byte[] bitmap, int padding, int hashCount) {
3231
if (bitmap == null) {
3332
throw new NullPointerException("Bitmap cannot be null.");
3433
}

firebase-firestore/src/main/java/com/google/firebase/firestore/remote/WatchChangeAggregator.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public interface TargetMetadataProvider {
8080
*/
8181
private Set<Integer> pendingTargetResets = new HashSet<>();
8282

83+
/** The log tag to use for this class. */
84+
private static final String LOG_TAG = "WatchChangeAggregator";
85+
8386
public WatchChangeAggregator(TargetMetadataProvider targetMetadataProvider) {
8487
this.targetMetadataProvider = targetMetadataProvider;
8588
}
@@ -236,9 +239,11 @@ private boolean applyBloomFilter(ExistenceFilterWatchChange watchChange, int cur
236239
new BloomFilter(
237240
bitmap, unchangedNames.getBits().getPadding(), unchangedNames.getHashCount());
238241
} catch (BloomFilterException e) {
239-
if (e instanceof BloomFilterException) {
240-
Logger.warn("Firestore", "BloomFilter error: %s", e);
241-
}
242+
Logger.warn(
243+
LOG_TAG,
244+
"Decoding the base64 bloom filter in existence filter failed ("
245+
+ e.getMessage()
246+
+ "); ignoring the bloom filter and falling back to full re-query.");
242247
return false;
243248
}
244249

0 commit comments

Comments
 (0)